I have a question about above function.
In my application on initialization I call:
getCamera()->setViewport(new osg::Viewport(0, 0, width(), height()));
getCamera()->setProjectionMatrixAsPerspective(20.0f,
static_cast<double>(width())/static_cast<double>(height()),
0.001f, 10000.0f);
getCameraManipulator()->setAutoComputeHomePosition(true);
This sequence makes my scene to be automatically scaled to fill the window.
When changing the angle from 20.0 to some larger value the scene just apears
smaller and vice versa.
What I expected is the calculation of the camera/eye distance comes out
different so the scene is filling the window again.
Obviously there is a misunderstanding from my side.
I came to the problem when trying to calculate and set a distance manually for
having the bounding box center plane of the scene to appear in "original
size". The distance should be
d = widthMM / (2.0 * tan (alfa/2.0))
widthMM = window width in mm
alfa = viewing angle used in "setProjectionMatrixAsPerspective" converted to
radians.
This calculation really shows my scene always in the same size, unfortunately
not the correct one. Again I don't understand things here.
I think there is a general misunderstanding from my side.
Thanks for any hints.
- Werner -
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org