Game Development Reference

In-Depth Information

and the same rotation interpolated using quaternions. The Euler angle

rotation appears very messy by comparison with the quaternion rotation.

Pressing 'q' switches to quaternion calculations and pressing 'e' switches

to Euler angle interpolation. Pressing the 'm' key steps between the

possible alternatives for Euler angles, rotating through
HPB
,
HBP
,
PHB
,

PBH
,
BHP
and
BPH
. Quaternions, in actual fact, represent a path across

a four-dimensional sphere, but if like me you find such concepts difficult to

visualize, then you will just have to accept the results of the maths rather

than the justification for its use. It is very difficult to specify a rotation

directly using quaternions, so many programs use either Euler angles or

angle axis for the interactive display in a development environment and

quaternions for interpolation.

Using Toon3D Creator for keyframe animation

Now that we have the ability to create keyframes and are also able to

interpolate these key positions, we need some data. Run Toon3D Creator,

where you can experiment with animation paths. Selecting an object in

the tree control makes it the active selection. The buttons in the toolbar

allow you to switch between translation, rotation, scaling or sizing modes.

Moving the mouse while pressing the left mouse key will translate, rotate

or scale in the
x
- and
z
-axes. Moving the mouse and pressing the right

button allows you to translate, rotate or scale in the
y
-axis. Axes can be

excluded using the toolbar buttons. See Figure 8.4, where the toolbar

Figure 8.4 Toon3D Creator toolbar buttons.

Search Nedrilad ::

Custom Search