Archived

This topic is now archived and is closed to further replies.

OleKaiwalker

Rotate a vector

Recommended Posts

OleKaiwalker    120
Hey, I''m working on a way to position moveable objects in a FPS game, and I would like to know, how to rotate a vector with the parsed in quaternion(0 <- x, 1 <- y, 0 <- z, 10 <- angle). I know it propably would be faster to create the object in object space and just use glTranslate and glRotate for the movement, but then I can''t use it properly with collision detection and per-pixel lighting.

Share this post


Link to post
Share on other sites
The way I have been told to do this and have done it a few times, was to move the object''s center to 0, 0, 0, rotate it on each axis however you like, then move the object center back to it''s original location. Then youc an do your lighting and detections!


-The Great Sephiroth

Share this post


Link to post
Share on other sites