Results 1 to 4 of 4

Thread: Rotation in openGL

  1. #1
    Junior Member Newbie
    Join Date
    May 2005
    Posts
    22

    Rotation in openGL

    I would like to rotate a scene upwards and downwards; not rotate by an axis, but simply rotate up and down. I've read the Red Book about specifying azimut/elevation, and translation, but I seem to be failing.
    Could anyone point me in the right direction or display some sample code that could get me started, please?
    Thank you...

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: Rotation in openGL

    I would like to rotate a scene upwards and downwards; not rotate by an axis, but simply rotate up and down.
    What do you mean by this?

  3. #3
    Junior Member Newbie
    Join Date
    May 2005
    Posts
    22

    Re: Rotation in openGL

    What I meant is, rotate the camera upwards/downwards, or around an "arbitrary" axis.
    For example, if I have a cube of volume 8 centered at the origin, and my camera is positioned at 3,3,3, how would I rotate the camera so that it will be above the cube? I believe I have to make some calls to glRotate*(...) and one call to glTranslate*(...). I was, however, unable to succeed.
    What shoul I do?

    Thank you...

  4. #4
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: Rotation in openGL

    Spend some time in a matrix algebra book, look for matrix tutorials, search this board (I'm sure this question or one like it has come up before). The opengl commands glRotate and glTranslate do nothing more than create a composite matrix for you, by concatenating individual rotation and translation matrices. Understand these matrices and you'll understand transformations in opengl. If you don't understand the math, you'll be agonizing over each new scenario...

Similar Threads

  1. OpenGL Rotation
    By abhi2711 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 05-05-2014, 05:47 AM
  2. Opengl Cube Rotation
    By david_w in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-05-2011, 10:26 AM
  3. Matrix Rotation loses 1 axes of rotation
    By Benzino in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-15-2011, 06:53 AM
  4. Replies: 1
    Last Post: 04-16-2010, 02:59 PM
  5. changing axis of rotation and center of rotation in openGL performer
    By ravishashi in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 07-08-2003, 04:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean