This project demonstrates a 3D cloth simulation using the Three.js library. The simulation replicates realistic cloth behavior such as deformation, stretching, and interaction with external forces. The project leverages physics-based principles, specifically Verlet integration, to model the behavior of cloth under gravity and user interaction.
- Realistic cloth deformation and stretching.
- Gravity-based physics simulation for cloth dynamics.
- Interactive mouse-driven influence on the cloth’s behavior.
- Camera controls using OrbitControls for better user interaction.
- Collision detection and response.
- Handles window resizing to maintain 3D rendering consistency.
Before running the project, ensure you have the following:
- A modern web browser (Chrome, Firefox, etc.).
- Basic understanding of HTML and JavaScript.
- Internet connection to load the Three.js library from the CDN.
- Online: Visit 3D Cloth Simulation to view it live.
- Clone the repository:
git clone https://github.com/gaurav00321/cloth-simulation.git cd cloth-simulation - Open the index.html file in any modern web browser.
- Simply open the index.html file in a web browser to view the 3D cloth simulation.
- Interact with the simulation using mouse movements to influence the cloth's behavior.
- Mouse Interaction: Use your mouse to interact with the cloth, applying forces that influence its behavior.
- Camera Controls: Use the mouse to rotate, zoom, and pan around the scene to explore the 3D cloth simulation.
Contributions to this project are welcome! Feel free to fork the repository and submit a pull request if you have improvements or additional features.
This project is licensed under the MIT License.