Tricks and Tips :
Deformation Cube Fun

by Nigel Doyle

Using Deformation objects can be simple and fun! With very little effort, you can create this sphere bouncing on a trampoline. This forms the foundation for achieving more complex animations.



Deformation cube

Create a deformation cube. By default trueSpace will place this at world center. i.e. x= 0, y = 0, z = 0 

Immediately after the deformation cube is created you are placed into edit mode. Here I have expanded the pop up menu to show the available tools.



Adjust lattice

We need to adjust the lattice resolution by dragging on the green arrows as highlighted. In the Z axis drag downwards to remove the middle green control lattice line. In the X and Y axes, increase the lattice resolution so that the cube is divided into 16 squares. At every green lattice line intersection there is a control vertex. We don't need the center control line as we are going to flatten the deformation cube in the next step.



Resize deformation cube

In the object information box, change the size of the cube to X = 4, Y = 4, Z = 0.2. This now completes the setup of the deformation cube.

When working with deformation objects it often helps to turn off the grid so that you can see the individual lattice line more easily.



Create cube with resolution of 4

From the Primitives menu use the right mouse button and navigate your way to the standard cube object. We need to increase the resolution of the cube so that we have some vertex points so that it can bend once it is attached to the deformation cube.



Apply texture to cube

Resize the cube primitive to X = 3.5, Y = 3.5, Z = 0.1. Position it over the deformation cube. It's good practice when working with objects controlled by deformation objects to apply the textures before linking them. In the animation at the top I dragged the checkered.bmp texture from the trueSpace texture directory with the image browser and used a default planar UV projection.

Rename the cube primitive to "Tramp" and reposition it to be in the exact center of the deformation cube. This should be Z = 0. At this stage if you are not working in wire frame display, change to this mode now.



Link deformation cube to Tramp

Select the deformation cube again and right click on it to go into edit mode. This will bring up the options menu.

Select the apply deformation tool as circled here. This changes the cursor to the familiar trueSpace glue bottle. Just click within the deformation cube and this will then connect the deformation cube to the cube primitive Tramp. In the next step we're going to animate 2 of the control points on the deformation cube. Because this is linked to the Tramp cube, it will follow along with any transformations.


Tech Tip: The "Tramp" cube can be animated separately and the deformation cube's animated transformations will only affect it while all or part of the "Tramp" cube is within the deformation cube. You can also link more than 1 deformation cube to the "Tramp" cube.



Begin animating

With the "Move" tool selected, enable grid snapping. Right click on the grid tool and change the snap settings to 0.5 for all axes. You may also want to open up a separate view as we want to select both of the center lattice control points.

Make sure that auto record is enabled and the frame count is at frame 0.

Select the local deformation tool then select the bottom center control point. It will be necessary to change your view a few times to see precisely what's going on. Right click and drag the control point down in the Z axis 2 increments i.e. 1 unit. Do the same with the top control point.



Apply SDS to make Tramp surface smooth when bending

It's now just a matter of advancing the frame count and adjusting the 2 control points. In the animated gif above I advanced the frame count to 10 and then moved both control points upwards by 3 increments. i.e. 1.5 units.

Advance the frame count to 30 and drag both control points downwards 3 increments, back to where we started. Don't worry about these amount looking excessive. The Tramp cube will only move part of the way. More movement can be obtained by animating more control points.

To make the "Tramp" cube smoother still I have applied 3 levels of Sub Division.



Animation frame 10

It's now just a matter of creating a sphere 1 unit in all 3 dimensions and placing it in the middle of the Tramp cube. Apply any color or texture that you want to the sphere.

At frame 0 Move the sphere downwards to line up with the top of the "Tramp" pad. This is approximately Z = 0.08. It helps to be in either a side or front view here to animate the sphere

Advance the frame count to 10 and move the sphere so that it is above the the "Tramp" pad. Z = 2.0. In this screen shot, notice that the mesh moves a lot higher than the Tramp pad.



Play animation

With the frame slider advance the frame count until the tramp pad is flat. This should be about frame number 17. Move the sphere down until it touches the pad. Z = 0.5.

Finally advance the frame count to frame 30 and move the sphere back to its original position Z = 0.08.

Check your animation by pressing the play button.



Finished animation

You should now have a nice bouncing ball on a trampoline. You can make the real time animation loop over and over again by right clicking on the play button and putting a check mark in the loop box. Set up your lights and render your animation.

If you want to make a looping animation like the animated gif above, just render frames 0 to 29. Don't render frame 30 as this is identical to frame 0 and including it would cause your animation to briefly pause. I used a shareware program "Gif Construction Set Professional to generate the animated gif. You can dramatically reduce the file size of the gif if you keep the background simple or a plain color similar to what I've done above. For lights, I used the colored lights from the light library and enabled cast shadows for all 3 lights.

If you want to make the bounce a bit more realistic, try editing the sphere's key frame control handles in the function curve editor in the Scene Editor (KFE truespace 5)



Hopefully I covered something new to you. By animating more lattice control points more complex animations can be achieved. Things like flags or vibrating musical instrument strings can be animated by using the techniques above.  Have fun!!