I am trying to control the camera in OpenCASCADE. As
input I have the pose (position and rotation) of a
real camera and it\'s focal length. So, I\'m trying to
set up a camera in the exact same pose in OpenCASCADE
and with same focal length.
The following is a test I carried out to understand
how to control the camera.
By using a V3d_Viewer object, I set the ViewSize and
the projection method (V3d_PERSPECTIVE). I don\'t know
what SetDefaultViewProj() means, it seems to have no effect
on my images.
To create a V3d_View object, I call V3d_Viewer::CreateView();
This gives me access to set the camera eye and the view
point by calling the methods SetEye(x,y,z) and SetAt(x,y,z).
The focal length can be adjusted by calling SetDepth().
Now, the problem is in understanding the resulting images
I get. Let me explain by example:
SetEye(0,0,-100) // sets camera positions
SetAt(0,0,-99) // sets view direction
(using default values for other parameters not shown here, such
as the up-vector)
As I understand the model, this should give me an opening
angle of 90 degrees. So if I place a plane centered at (0,0,0)
with a height of 200, I should now be able to see exactly that
plane in the vertical direction of the image. But I see a bit more
than the plane. If I call SetDepth(1.5) I see exactly the
height of the plane. This doesn\'t make sence to me.
If I try to scale this by setting ViewSize to 8, I then assume
that the SetDepth() call should be scaled linearly according to
the change in ViewSize, so by using the 1.5 scale factor I guess
I should call SetDepth(4*1.5). But it turns out that I should
call it with 6.3 instead of 6 in order to see exactly
Is there something about the view-model I need to know?
Any help appreciated.