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: How to know the virtual camera's focus length!

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2002
    Location
    China Xi'an
    Posts
    3

    How to know the virtual camera's focus length!

    I use the OpenGL to make a virtual camera, use the glulookAt(eyex,eyey,eyez,centerx,centery,centerz,u px,upy,upz)function. Is the camera focus length can be calculated using f=SQRT[(eyex-centerx)^2+(eyey-centery)^2+(eyez-centerz)^2],it is the distance of eye point to the center point, I put one object on the (0,0,0) position ,and the camera's focus is fixed,after the change position of eye, the center position must changed too, otherwise the focus length f will not be fixed ?is that right?
    Thank you very much!

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

    Re: How to know the virtual camera's focus length!

    If I understand the question correct, you think that gluLookAt varies the field of view of your camera settings.
    No gluLookAt only affects the position and orientation.
    Have a look at gluPerspective (field of view parameter) or more general glFrustum to vary the focal length of a virtual camera.


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

Posting Permissions

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