Game Development Reference
In-Depth Information
In order to rotate the quad by an angle Ɵ we transform each vertex by a rotation matrix R .
For each vertex we perform the transformation such that:
Notice that we are working at an object level rather than at a pixel level, this is because
we are taking advantage ofmodern GPUsto perform the actual per-pixel transformation of
the rotated image. Typically we wouldn't perform the vertex transformations by hand as
described here (doing so is possible, but would be done on the running thread on the CPU
rather than taking advantage of the GPU), instead we would build our transformation mat-
rix that mayinclude translation, rotation and/orscale thenwewill sendittotheGPUwhen
weareabouttorenderourobject,theneachvertexwillbetransformedinthevertexshader.
1.3.2.1Bitmap Rotation
The rotation as described so far, will work to rotate images at the pixel level if we were
to transform each pixel position by the matrix R . However, in this case, it would not give
Search WWH ::




Custom Search