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 3 of 3

Thread: Camera issues

  1. #1
    Intern Contributor
    Join Date
    Nov 2002
    Location
    Torun/Poland
    Posts
    60

    Camera issues

    How to make camera reflect changes
    in my object's orientation.

    I have matrix attached to my object,
    which i use to feed glMultMatrix().

    I want camera to roll/pitch/yaw/move as my object does.

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: Camera issues

    There's no "camera" in OpenGL.
    Apply the inverse rotation to the rest of the world (at the top of the transformation hierarchie).
    This will give a first person shooter or flight sim look.

    [This message has been edited by Relic (edited 12-20-2002).]

  3. #3
    Intern Contributor
    Join Date
    Nov 2002
    Location
    Torun/Poland
    Posts
    60

    Re: Camera issues

    Only rotation, or also translation?

    When I made it in a way like this:

    rotate(XYZ) > modelMatrix;
    translate > modelMatrix;

    transpose(modelMatrix) > InvmodelMatrix

    and when drawing:

    glLoadIdentity();

    glMultMatrix(InvModelMatrix);
    gluLookAt(distance, 0,0,
    0, 0, 0,
    0, 1, 0);

    scene....

    glPushMatrix()
    glMultMatrix(modelMatrix);
    glPopMatrix();

    I received only a small stripe of scene across window,
    everything else was black;

Posting Permissions

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