Game Development Reference
In-Depth Information
Rotation matrices can only be used to perform rotations about the origin of the coordinate
system. This means that in order to rotate any point about a position that is not the origin
of the coordinate system, we will need to first translate this point into a position relative to
the origin, perform the rotation and then translate the point back to its previous position.
1.3.2 Object Rotation
We now can apply these concepts to perform rotation on an image mapped onto a polygon.
For simplicity we'll rotate quad with a spaceship texture mapped onto it.
Figure 15 - Rotation of a texture mapped quad.
A unit quad consists of four vertices defined by the positions:
We construct it by ordering the vertices into two triangles built in counter clockwise order,
the triangles would be defined by the vertices indexed such that:
Search WWH ::




Custom Search