Creation of a Scene (1/9)


Description

The objective of this tutorial is to create a simulation with collisions between a deformable body and an obstacle. We will use some of the most common components of the SOFA framework trying not to enter into all the details related to the template selection. This will be done in another tutorial.

Find the icon on the far left of the toolbar in the Modeler. It looks like a piece of paper with the corner folded, and its tool tip is New Tab. Press the button.

This will give us a scene graph with some default components.

Right click on the TreeCollisionGroupManager and select Delete.

We don't need this component for our scene.

Find the OglModel component with the Filter, and drag and drop it onto the root node. Double click the OglModel node to edit its properties.

Rename the model "Objective".

Under the Property 2/3 tab, find the fileMesh section. Click on the ... button to bring up the file browser. Select the file /Sofa/share/mesh/dragon.obj, and press OK to return to the Modeler.

We now have a scene with all the components needed to handle collisions in a scene, and a visual model representing our deformable object.

Key points

This is how the collisions are performed in SOFA using these default components.

DefaultPipeline: Launch all the operations to perform the collision detection and response

Collision Detection:

  1. Broad Phase: using "Axis Aligned Bounding Boxes" (AABB), we only keep potential colliding pair of objects
  2. Narrow Phase: we use the geometrical primitives (spheres, triangles, lines, points) to test the distance between two objects.
    we use the BruteForceDetection to select which primitives will be used, and the MinProximityIntersection to detect if a collision exists between two geometrical primitives

Collision Response:

  1. With all the colliding primitives, we create an appropriate collision response: the ContactManager gives the information about what response we have to use.
  2. Components are created dynamically in the graph to create repulsive forces, or constraints. In this tutorial, we will create PenalityContactForceField.

Advanced collision detection and response are implemented in SOFA, so don't hesitate to experiment other examples.

Results

Press the Run in SOFA (or press Ctrl-R), and press Animate

In this scene, we only have a OglModel corresponding to a pure visual representation of an object.
Nothing happens.


Next