PDA

View Full Version : rotating an object


broli86
04-26-2008, 11:33 AM
to rotate an object about an axis by angle theta, is it necessary to rotate all the vertices by that angle about that axis using the standard matrix for rotation.
or is there a smarter way out ?

Reedbeta
04-26-2008, 01:22 PM
If you're using OpenGL or Direct3D, you can use the graphics card's built-in matrix multiplication features to do the transformation for you.

If you're doing raytracing, you could try transforming all rays by the inverse rotation before intersecting them with the object. That might or might not be any faster than transforming each vertex of the object once before raytracing starts.