PDA

View Full Version : How to know the virtual camera's focus length!



xjtu_sy
10-09-2002, 06:18 PM
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!

Relic
10-10-2002, 12:15 AM
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).]