top of page

Jello Simulation

In my Physically Based Animation (CIS 563) class we were given an assignment with base code to create a program using C++ in Microsoft Visual Studio that would generate the position at fixed time steps of a cubic mesh meant to simulate jello. Each cube had a set number of vertices defining its shape, and at every time interval the vertex positions would be calculated according to gravity and collision calculations. The base code I was given had pre-written code for RK4 integration, however I programmed all collision detection and resolutions between the cubes and rigid bodies and between cubes and other cubes. For the cube on cube collisions, I created an invisible bounding sphere around each cube and then calculated collisions based upon a cube mesh and sphere collision detection method. In order to keep the cubes stable during collisions, I used a mass-spring system, implementing bend and structural springs between vertices on the same edges,  and shear springs between diagonal vertices. After creating the simulation in my C++ program, I wrote the vertex points of each mesh out to a separate .txt file. Then, in Maya I created the same number of cubes as in my simulation, making sure they had the same number of vertices as those in the simulation. I used MEL scripting to parse the .txt files and keyframe each cube vertex in Maya to the specified position in the .txt files. Lastly, I added meshes that imitated those the cubes collided with in my C++ simulation, and textured, lit, and added depth of field to the scene in Maya and rendered the animation in V-Ray so that the jello cubes could be rendered more realistically.
bottom of page