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: gluLookAt

Hybrid View

  1. #1
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    gluLookAt

    I am currently using the following method to position my "camera"

    (I know that rotation x y z is not strictly correct but eaiser that pitch roll yaw)

    glTranslated(pos_x, pos_y, pos_z)
    glRotated(rot_x, 1.0, 0.0, 0.0)
    glRotated(rot_y, 0.0, 1.0, 0.0)
    glRotated(rot_z, 0.0, 0.0, 1.0)
    (I might have rotated first, I cant remember)

    this works fine for me, but should I be using gluLookAt insted. Dose it do the same thing to the matrix (I make my translations and rotations to the modelview matrix before I start drawing and positioning my objects)

    Thanks

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    601

    Re: gluLookAt

    Either can be used. Depends on your purpose, in my opinion. Also, which is easier for you to calculate. If what you showed works, then no reason to switch. But, yes, both will change the current matrix.

    If you do decide on gluLookAt, make sure that the eye and center coordinates ar never equal (same point) and that the vector formed by those 2 points are never parallel to the up vector.

  3. #3
    Intern Contributor
    Join Date
    Apr 2002
    Location
    UK
    Posts
    50

    Re: gluLookAt

    Thanks.

    I'll continue using my method to save making new calculations (work out what I want to look at based on my rotation data) but I will probably use LookAt when I do my chase cam stuff.

Posting Permissions

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