Beginning Math and Physics for Game Programmers

 <  Day Day Up  >  

Chapter 6, "Transformations"

2D Translation by Addition

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

3D Translation by Addition

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

2D Translation by Multiplication

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

3D Translation by Multiplication

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

2D Scaling

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

3D Scaling

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

where q is the angle of rotation.

3D Rotation About the z-Axis (Roll)

where q is the angle of rotation.

3D Rotation About the x-Axis (Pitch)

where q is the angle of rotation.

3D Rotation About the y-Axis (Yaw)

where q is the angle of rotation.

2D Combo Matrix

For every 2D combo matrix

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

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 = B T A T for matrices A and B:

 <  Day Day Up  >  

Категории