View Full Version : Rotating to be parrallel to a plane
12-23-2003, 03:48 PM
Once I've defined my viewing, using glOrtho, I use glRotate to rotate around my origin in two aspects, around the x axis and around the y axis (y being the standard 2d mathmatically y axis). What I need, is to be able to rotate to make the camera be inside the normal of a plane, facing the plane defined by the equation ax+by+cz=b. This needs to be in terms of the two rotations above, and can take place in reference to the origin. Any ideas?
12-30-2003, 05:32 AM
Project normal on xz plane, get the angle between the projected normal and 0,0,-1 vector and rotate around the y axis with that angle. Then project the normal on the yz axis, get the angle between that and the 0,0,-1 vector and rotate around x-axis with that angle. Of course you will have to respect the direction of the rotation, which can be done with the yz plane and xz plane respectively and seeing on which side of the planes the normal points.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.