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

  1. 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).
  2. 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.
  3. 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).
  4. 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.
  5. Visual Polish

    • Details: Translucent rendering with alpha blending. 3D Ground Platform generation (volumetric stage). Stress visualization mapping spring deformation to color.

Acknowledgements