Interactive Jello Soft Body Physics
By Yousef Abdelhadi→This showcase implements a 3D Volumetric Soft Body Simulation using a mass-spring system. Unlike the 2D cloth in A8, this project simulates a solid 3D object with internal structure, volume preservation, and complex physical interactions.
Features Implemented
3D Volumetric Mesh Generation
- Details: Generates a 3D grid of vertices (6x6x6). Constructs a complex network of structural springs (x, y, z axes), shear springs (diagonals), and Bending Springs (2-hop connections) to maintain volume and shape.
- Dynamic Mesh Switching: Supports real-time switching between Cube and Sphere topologies (in
JelloState::set_material).
Robust Physics Engine
- Details: Uses a Local-Global solver with 100-500 iterations (adaptive based on material) for rock-solid stability even with extreme stiffness.
- Safety: Implemented velocity clamping and air resistance in
main_showcase.cpp(pre-draw loop) to prevent mesh inversion.
Interactive Materials
- Details: Dynamic material system that updates physics parameters (
k,damping,restitution,friction) in real-time. - Presets: Jello (Balanced), Slime (Bouncy), Dough (Heavy), Basketball (Rigid Sphere).
- Details: Dynamic material system that updates physics parameters (
Advanced Mouse Interaction (Area Grabbing)
- Details: Implemented Area Grabbing where the user grabs a cluster of vertices within a radius instead of a single point. This creates a rigid “chunk” hold. Includes velocity transfer for throwing.
Visual Polish
- Details: Translucent rendering with alpha blending. 3D Ground Platform generation (volumetric stage). Stress visualization mapping spring deformation to color.
Acknowledgements
- libigl: For geometry processing, viewer, and project/unproject functions.
- Eigen: For linear algebra operations.
- CSC317 Course Materials: Base mass-spring system theory (A8) and Shader concepts (A6).
