PDA

View Full Version : How to calculated the virtual camera's focus



xjtu_sy
10-09-2002, 07:24 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!