Cloth and Fluid Simulation

View on GitHub

Overview

This project delivers two advanced physics simulations — cloth and fluid — developed in Processing. The cloth simulation realistically models fabric behavior including collisions and natural draping, while the fluid simulation generates dynamic wave interactions based on user input. The project combines high-quality rendering, 3D visualization, and interactive controls to create a rich simulation experience.

Key Features

🧵 Realistic Cloth Simulation

  • Multiple ropes interconnected vertically and horizontally to form a dense, flexible fabric.
  • Cloth deforms naturally around obstacles, responding dynamically to environmental forces.
  • Rendered in a fully interactive 3D space allowing free camera movement.
  • Applied realistic fabric textures for enhanced visual authenticity.
  • User interaction enables moving obstacles and manipulating the camera to observe cloth behavior in real time.

🌬️ Air Drag Simulation

  • Introduces air resistance forces slowing the cloth’s motion, preventing immediate snap-back and producing natural movement dampening.

💧 Fluid Dynamics Simulation

  • Implements a PDE-based fluid model to simulate water waves inside a pool.
  • Waves react dynamically to external interactions, creating lifelike fluid motion.

Challenges & Solutions

  • Achieving realistic cloth texturing was challenging due to limited documentation on UV mapping in Processing. Meticulous experimentation enabled natural fabric appearance.
  • Integrating collision detection ensured seamless interaction between cloth and obstacles, enhancing realism.

Development Details

  • Platform: Processing
  • Languages: Java-based Processing
  • Simulation Focus: Cloth physics, fluid wave modeling, interactive 3D rendering

Credits