Previous Section  < Day Day Up >  Next Section

Chapter 6, "Transformations"

2D Translation by Addition

graphics/ap01equ18.gif

where dx = change in x and dy = change in y.

3D Translation by Addition

graphics/ap01equ19.gif

where dx = change in x, dy = change in y, and dz = change in z.

2D Translation by Multiplication

graphics/ap01equ20.gif

where dx = change in x and dy = change in y.

3D Translation by Multiplication

graphics/ap01equ21.gif

where dx = change in x, dy = change in y, and dz = change in z.

2D Scaling

graphics/ap01equ22.gif

where Sx = scale factor in the x direction and Sy = scale factor in the y direction.

3D Scaling

graphics/ap01equ23.gif

where Sx = scale factor in the x direction, Sy = scale factor in the y direction, and Sz = scale factor in the z direction.

2D Rotation

graphics/ap01equ24.gif

where q is the angle of rotation.

3D Rotation About the z-Axis (Roll)

graphics/ap01equ25.gif

where q is the angle of rotation.

3D Rotation About the x-Axis (Pitch)

graphics/ap01equ26.gif

where q is the angle of rotation.

3D Rotation About the y-Axis (Yaw)

graphics/ap01equ27.gif

where q is the angle of rotation.

2D Combo Matrix

For every 2D combo matrix

graphics/ap01equ28.gif

entries with an r store scaling and rotation information, and entries with a t store overall translation information.

3D Combo Matrix

For every 3D combo matrix

graphics/ap01equ29.gif

entries with an r store scaling and rotation information, and entries with a t store overall translation information.

Conversion Between OpenGL and DirectX Formats

AB = BTAT for matrices A and B:

graphics/ap01equ30.gif

    Previous Section  < Day Day Up >  Next Section