Results 1 to 3 of 3

Thread: gluLookAt PROBLEM!

  1. #1

    gluLookAt PROBLEM!

    How does the gluLookAt work?
    I have a object that I want to look at from different angles, starting looking from above. The eye rotates smooth around the airplane if I only increase the value for one axis at the time. But in combinations and if I try to increase the z-value,then it won't work as I think it should.
    And when I increase the value for x or y then I have to have z=1 for it to work.

  2. #2
    Member Contributor
    Join Date
    Mar 2000
    PA, USA

    Re: gluLookAt PROBLEM!

    Be careful using gluLookAt. The eye and focus points are easy enough to get, but the
    up vector is what can cause problems. If you take the vector from the eye to the focus point, the up vector should not be in the same or opposite direction. The trouble comes when you adjust the eye and focus points, but not the y-vector. Your scene may turn upside down (or some variation of "not right-side up", or disappear completely.

    One way to avoid this problem is to use gluLookAt to initially setup your camera and use the other OGL matrix functions to apply transformations to the result of the gluLookAt function.

    Hope this helps. Good luck.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000

    Re: gluLookAt PROBLEM!

    Some more information about the up vector...
    The angle between the line of sight and the up vector is always 90 degree. The upvector tell gluLookAt how the camera is rotated about it's own line of sight, in other words, it's a quite important thing.

    By the way, thanks for that tip Ben, gotta try it out when I get home


Similar Threads

  1. Problem with gluLookAt
    By JunkerKun in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-28-2013, 09:38 PM
  2. Problem with gluLookAt
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-13-2006, 04:55 PM
  3. shadows problem and gluLookAt()
    By MaNDROiD in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-03-2004, 07:26 AM
  4. Problem with gluLookAt
    By wazoo in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 09-24-2004, 06:42 PM
  5. Problem with gluLookAt
    By djavan in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 03-04-2003, 08:18 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