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: The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000?

  1. #1
    Junior Member Newbie winterheat's Avatar
    Join Date
    May 2012
    Posts
    2

    Question The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000?

    I am trying LookAt in OpenGL ES,

    Code :
    [FONT=Courier New][B]        gluLookAt(512, 384, 2000,
                      512, 384, 0,
                      0.0f, 1.0f, 0.0f);[/B][/FONT]

    The second row is the Target's position... so I wonder, if I change the z from 0 to 1000 or -1000, shouldn't what is seen different? They turn out to be all the same, why is that?

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    The first three values state the position the camera is located at, the second the position you look at. If you move the second point along the axis you're looking at, the viewdirection stays the same. The third vector defines the up vector of the camera and thus the rotation of the camera relative to the viewing direction.

Tags for this Thread

Posting Permissions

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