Creation of a Pendulum (2/8)

Description

In the previous scene, no solver was present, so no simulation was done. In this step, we will add an ODE solver in the Root node of the simulation. We provide several ODE solvers, with different integration schemes. Take a look at our tutorials on Solvers later.

Key points

We will use the classic explicit euler solver EulerSolver to update particle positions and velocities at each time step. In SOFA, a solver acts on all the object placed below in the hierarchy.

In the Modeler's Filter textbox, type "Euler". Click and drag the EulerSolver component over the root node. Press the Run in SOFA button. Press Animate.


Results

This time, when you animate the scene, the particule falls along the direction of the gravity.
The gravity is specified in the root node of the simulation. We use a default value of (0, 0, -9.81).

In the Modeler scene graph, double click the root node.

This opens the components for this node, and allows you to edit them. We won't make any changes for now.

Press OK to return to the Modeler window.

Changing the gravity on child nodes of the simulation will not do anything as at each time step the gravity, and other parameters, (time, dt...) is overwritten using the value specified in the root node.
The component Gravity lets you specify a particular gravity for a node and all its children.

To see an example of this, type "Gravity" into the Filter textbox in the Modeler. Click on the Gravity component. In the top right section of the window, a description of the component will appear, with links to examples. Click on the links to open the example scene in the Modeler. When you are done, close the Gravity.scn tab to return to the tutorial scene.


Previous ____________ Next