Game Development Reference
In-Depth Information
Figure 1.4. Translation and rotation.
The affine transformation will end up adding the vector y to any point we
apply it to, so y achieves translation for us. Rotation is stored in the matrix A .
Because it is for us convenient to keep them separate, we will use the first form
more often. So in three dimensions, translation will be stored as a 3-vector t and
rotation as a 3
3 matrix, which we will call R .
The following equation, also known as the Rodrigues formula, performs a
general rotation of a point p by θ radians around a rotation axis r :
cos θ p +[1
cos θ ]( r
p ) r +sin θ ( r
p ) .
This can be represented as a matrix by
tx 2 + c y
txz + sy
ty 2 + c z
R r θ =
txy + sz
tz 2 + c
tyz + sx
= x, y, z ) ,
=cos θ,
= in θ,
cos θ.
Both translation and rotation are invertible transformations. To invert a trans-
lation, simply add
y . To invert a rotation, take the transpose of the matrix.
One useful property of rotation is its interaction with the cross product:
R ( a
b )= Ra
Rb .
Note that this does not hold true for all linear transformations.
Search Nedrilad ::

Custom Search