- Your Second Program

The fundamental transformations: Translation, Rotation and Scaling, were introduced in Chapter 1. These can be represented in a number of different ways. In fact six different transformation types are available in BRender.

The simplest is the **Identity Transform**, which specifies the *identity matrix* as the transformation matrix. The identity matrix does not alter an actor's shape or position. It makes an actor effectively share its parent's co-ordinate space. The **Translation** transformation is used to implement a translation (useful when no rotation or scaling are involved in a transformation). The Translation transformation type is represented in BRender as a vector that is added to an actor's co-ordinates. **Euler**, **Look-Up** and **Quaternion** transformations all specify a translation and an orientation.

The Euler transform applies three separate rotations in turn, in a specified order. Euler angles are the generalisation of the pitch-yaw-and-roll of flight simulators.

A look-up transformation is a convenient method of making an actor, often a camera actor, point towards a particular position. A *look* vector is used to specify the view direction, and an *up* vector to define the orientation.

The unit quaternion transform represents a rotation about an arbitrary vector. Quaternions are used in computer animations for interpolating the positions of tumbling bodies between key frames.

The most general representation is the **Matrix Transform** `(BR_TRANSFORM_MATRIX34)`

. All the transformation types discussed above can be implemented using matrices (refer to Chapter 1 of this guide and to `br_matrix34`

in your technical reference manual for details of how matrix transforms are performed). You will recall from Chapter 1 that matrices can be concatenated, allowing a complex sequence of transformations to be pre-processed into a single transformation matrix. Not surprisingly then, computer graphics systems normally represent transformations internally using matrices.

The transformations implemented in our tutorial programs use the `BR_TRANSFORM_MATRIX34`

representation. Feel free to experiment with the other available implementations. Refer to your technical reference manual for details of relevant structures and data types.

Generated with CERN WebMaker