PolygonPlayground is an interactive 3D physics simulation that brings geometric shapes to life in your browser. This project showcases the intersection of design and technology, offering a playful and engaging experience for users to explore the dynamic behavior of polygons in a virtual environment.
- Real-time 3D physics simulation
- Interactive camera controls
- Customizable parameters for experimentation
- Responsive design for various screen sizes
PolygonPlayground uses Three.js for 3D rendering and Cannon.js for physics simulations. The main components are:
- Container: A 3D box that constrains the movement of the polygons.
- Polygons: Represented as rounded boxes, these objects interact with each other and the container walls.
- Physics: Gravity and collision detection create realistic movements and interactions.
- Camera: An orbiting camera allows users to view the simulation from different angles.
Designers and developers can easily modify the simulation to create unique experiences:
- Adjust the
params
object insketch.js
to change the number of boxes, their size, container size, and gravity strength. - Modify the
styles.css
file to customize the appearance of the container and canvas. - Experiment with different geometric shapes by replacing the
RoundedBoxGeometry
in thecreateBoxes
function. - Add new interactions or visual effects by extending the
render
function or creating new event listeners.
To run PolygonPlayground locally:
- Clone this repository
- Open
index.html
in a modern web browser - Double-click anywhere in the container to throw the boxes
PolygonPlayground serves as a starting point for various design explorations:
- Study how different parameters affect user perception and engagement
- Experiment with color schemes and visual styles to evoke different emotions
- Incorporate this simulation into larger interactive experiences or data visualizations
- Use it as a tool for teaching basic physics concepts in an intuitive, visual manner
We encourage you to fork this project, experiment with the code, and share your creations with the community. Let's push the boundaries of interactive design together!