For this project, I created a system to convert kinematic-based motion into physically plausible terrain deformation. I compute such interactions in real time, from only the kinematic motion of a virtual character. I rely on a standard stress-strain relationship to compute the dynamic deformation of the soil under this force, where the amount of compression and lateral displacement of material are, respectively, parameterized by the soil’s Young modulus and Poisson ratio. The resulting footprint is applied to the terrain through procedural deformations.
To calculate the force directly from the kinematic data, the following module converts keyframe data into forces applied by each foot on the ground during contact. These are estimated from the weight of the character, its current balance, the foot speed at the time of contact, and the nature of the ground.
Part of a bigger project. To populate interactive, evolving virtual ecosystems of preys and predators, I designed this procedural system to animate the living beings moving in the world. A target defines a position objective, and a series of splines is designed to move the legs of the agent based on their distance to the ground. The body and head are procedurally adapted based on the terrain slope as well.
I bring here some examples in Unity (C#) that I did during my PhD and ended up using for my work:
Library extension of Position-based Dynamics using C# to use in Unity. Fast and ideal for light physics.
Commented implementation for Forward And Backward Reaching Inverse Kinematics (FABRIK), a simple and reliable Inverse Kinematics algorithm.
Unlike normal PD controllers, antagonistic reformulations allow to separate position and stiffness control, ideal to represent different tension and relaxation but keeping the same autonomy for controlling the target angle.