View Full Version : Defining rotations parallell to a plane
12-16-2003, 11:46 AM
If I have a plane equation, is there an easy way to have GL rotate parrallell to this plane, or must I do it mathematically? For instance, x+2z=30 is the plane, and I've got rotation in terms of Rotation around the XY axis and around the Z axis.
Solution anyway is mathematical
and i think, quaternion could be the answer.
(a bit hard to understand at the beginning, but quite elegant and CPU-ticks-saving)
read about quaternions at http://www.gamedev.net/reference/articles/article1095.asp
i dont know why you need quaternions for this ( maybe i misunderstand the question)
If you have a plane, you have a normal on that plane. If you use that normal as the 3 last parameters of glRotatef(angle, x,y,z), the angle will rotate around that axel, and therefor parallell to the plane
12-18-2003, 02:34 PM
Sorry, poor wording on my part, yeah you're right that would be a really simple ay to do it. Unfortunately what I need to be able to do is rotate not parrallell to the plane, but rotate my camera to be parralell to the plane from being in an aribtrary position.
[This message has been edited by Clayton (edited 12-18-2003).]
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.