Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Rotating to be parrallel to a plane

  1. #1
    Intern Newbie
    Join Date
    Jul 2003
    Posts
    42

    Rotating to be parrallel to a plane

    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?

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,074

    Re: Rotating to be parrallel to a plane

    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.
    - Michael Steinberg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •