Creation of a Scene (2/9)


Description

In this step, we add a mechanical object with a mass and a solver to simulate our deformable body. See this tutorial

Add a new node to the root node. Rename the new node "Object".

Add an EulerImplicitSolver, CGLinearSolver, MechanicalObject and UniformMass component to the Object node.

Key points

We will add an internal force field, the PlaneForceField. It simulates a plane (direction + distance to the origin).
As a start, we will simulate a collision with a floor using this kind of "virtual object". In further steps, we will see how to use any real object as an obstacle.

Find the PlaneForceField component and add it to the Object node. Open the PlaneForceField properties, and change the plane normal property from (0 1 0) to "(0 0 1)", and the plane d coef property from 0 to "-10". In the root node properties, change the gravity from (0 -9.81 0) to "(0 0 -9.81)"


Results

Run in SOFA and animate.

A particle falls along the direction of the gravity, and remains on the plane defined by the PlaneForceField. Our dragon doesn't move. (Note: you may need to adjust the viewing angle in SOFA to see the plane. Make sure Collision is selected in the View tab in SOFA.)

Related

Modify the parameters of the PlaneForceField, and understand your changes.


Previous ____________ Next