PDA

View Full Version : camera view problem



04-02-2005, 03:19 AM
Dear all,

Please help.
I just recently move a cad program from Direct3D to OpenGL. (Direct3D uses Left hand rule, I use Right hand rule axis system for my OpenGL).
Direct3D sometimes gives me blank picture without any warning.

Using DelphiX 2000 and Delphi 5, After creating the objects and the camera using OpenGL, I come with truncated view. I have tried to change the FocalLength and DepthOfView but still I can not see the whole scene, only part of an object. I can rotate it, but can not make it smaller although I use very small FocalLength (1.0).

Please help me to fix this problem.
Thanks.

redarrow
04-02-2005, 05:24 AM
Unless I'n getting your point all wrong here,
why not just move the camera back instead of changing the field of view?
Just use gluLookAt to reposition the camera.

Overmind
04-02-2005, 07:23 AM
Perhaps there is something wrong with your field of view calculation... How do you set the focal length?

04-05-2005, 05:57 AM
Finally I figured out the problem source. Something wrong with the GLScene component for Delphi. I install the latest version of GLScene and it display the view correctly.

But please explain more how should I calculate the camera parameters to capture whole object with any size (zoom all command) :

- For example, I have a mesh with object center at xo,yo,zo and with object size A

- I want to put camera at xc,yc,zc
- How do I calculate xc,yc,zc and DepthofView and FocalLength to get the whole scene on viewport?

Thanks for your advice.
Nathan