Handwritten Text Recognition for manuscripts and early printed texts
Tutorial two cubes falling on a floor due to gravity
1. Tutorial Two Cubes Falling On
A Floor Due To Gravity
School of Electrical Engineering & Computer Science,
1
National University of Sciences & Technology, Pakistan
2. What’s new
• This tutorial is the continuation of the First one.
• In this simulation exercise you will make two cubes
fall due to Gravity on a static/rested non-translating
floor.
3. Copy Previous Work
• Now select cube node and press Ctrl+c to copy that
node along with whole graph Associated to it.
4. Copying the Previous work in the
new scene
• To Open New Scene File tab click on the New Tab on
the top left corner under File.
• Click on the Root node to select it and press Ctrl+v to
paste the cube node and its graph under Root node.
• This time don’t delete the by default provided
components from the Root Node as they will be
needed to resolve the Collision and Contact issues
which will be experienced by us
– as more then one object exists in the animation
– which will raise a possibility of collision/contact with each
other.
6. Copy the cube node
• Rename the cube node with cube 1.
• Copy the node.
• Select the Root Node.
• Paste the cube node on it.
• Go the newly pasted cube node.
– Rename it with cube 2.
8. Cube’s initial position’s
translation
• Go to the transformation tab of the mechanical
state object of the cube 1.
– Over write the already written 0, 0 and 0 in the blanks
placed in front of translation of DOF (under Translation)
with 0, 10 and 0.(it will translate the initial position of
the object’s vertices, 10 units toward Y-axis)
• Do the same with the OglModel object of the cube1
node.(it will Translate the graphical model of the
object 1 units in the Y-axis)
10. Cube2’s initial position’s
translation
• Now in the same way as described in the last slide
go to the Transformation tab of the Mechanical
State Object and OglModel Object of the cube 2.
– Replace the by default written 0,0 and 0 with 10,10 and
0 (which will translate the object vertices and the
Graphical Model to the 10 units in the X-axis and 10
units in the y axis).
12. Simulation Results till now
• Now click the run Sofa button and Animate it, you
will see two cubes placed along side each other
falling in parallel to each other due to gravitational
force.
13. Adding the floor in the
simulation
• Now drag and drop another node on the Root node.
– Name the new node as floor.
• Add Meshtopolgy and Mechanical State of Vec3d under
the floor node.
– In MeshTopology give C:sofasharemeshfloor.obj in the
file topology.
• Add another GNode for the visual purpose under the
floor node.
– Name it floorVisual.
– Add the OglModel under new GNode.
• Give file mesh, Path to the mesh/floor.obj
15. Simulation Results before Collision
implementation
• Now after this check out the animation you will see
two cubes falling due to gravitational force and
eventually passing through the floor.
• They did not bounce back or stopped while colliding
with the floor because no collision model is added
in any of the three objects.
• For this we will add another GNode dedicated for
the collision model purpose. (like Visual node is
dedicated for Visual issue handling).
17. Adding Collision Model
• Now add the TSphereModel object (placed in the
drop down of the Collision Model present in the
sofa component) in the collision node of both of the
cube nodes.
• In a Same way add the TtriangleModel in the floor
the collision node of the floor node.
19. Force Field
• Now animate the simulation after clicking run sofa.
• After colliding with the floor, you will see cubes getting
de-shaped like a spilled water on floor.
– The reason behind this is the force applied/acting on one
vertices is not getting transferred to other vertices.
– So the vertices of the cube act like 8 different particles joint
together with a zero tension wires.
• To avoid that we have to add a force field
– It will transfer/project and relate the force of one vertices of
the object with the other one using some physical
properties.
20. MeshSpringForceField
• For this purpose we will add the Mass Spring Force
Field in both of the cubes.
• To do so Drag and drop MeshSpringForceField from
the drop down of Force Field component.
• In Property1/3 change the stiffness to 1000.
– This will lessen the water spill over like property of the
cube vertices by increasing the stiffness of virtual springs
connecting the vertices of the object.