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: Rotation Origin

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    Newcastle-Upon-Tyne, Tyne and Wear, England
    Posts
    8

    Rotation Origin

    Hi everyone,

    I managed to fix my last problem by using fixed camera positions (thanks for all your help btw ). The next problem is to do with the origin of rotation. Normally it is fixed at the centre of my model and I use gluLookAt to allow you to zoom in and out and glRotate to let you spin the model.

    e.g.

    gluLookAt( 0.0f, 0.0f, -m_dZoom,
    0.0f, 0.0f, 0.0f,
    0.0f, 1.0f, 0.0f);
    glRotatef(yRot, 1.0f, 0.0f, 0.0f);
    glRotatef(xRot, 0.0f, 1.0f, 0.0f);


    The problem I have is that I want to be able to change the rotation origin to another place in my model at request. Can anyone help me with the code?

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2001
    Location
    Newcastle-Upon-Tyne, Tyne and Wear, England
    Posts
    8

    Re: Rotation Origin

    *laughs his arse off!* I've worked it out now. You simply translate before you draw the model to effectively move the origin of rotation!

Posting Permissions

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