Hi,

i want to create a visualization of the view volume of a camera. 

I created a test application with two views and two cameras. I want to use one 
view to take a look at the created volume.

This is what i did so far:

I created an osgGA::TrackballManipulator() and assigned it to the camera of 
viewA:


Code:

        osgGA::TrackballManipulator *Tman = new osgGA::TrackballManipulator();
        viewA->setCameraManipulator(Tman);




Look at position:

Code:

                osg::Vec3d center;
               viewA->getCamera()->getViewMatrixAsLookAt(eye, center, up, 
distance);
                sphereXForm->setPosition(center);




I tried to use 'eye' as a source for the camera position but that did'nt work.

Finnaly i used the TrackballManipulator to get the eye/camera position:

Code:

            sphereXFormB->setPosition(Tman->getCenter());




sphereXForm and sphereXFormB are two spheres that show me the positions.

As for now i just have the camera position and the direction. Is this 
sufficient to create a view volume using:

Code:

viewA->getCamera()->getProjectionMatrixAsPerspective(fovy, ratio,
                                znear, zfar);



? In which units are fovy, ratio etc. stored? I mean can i just take fovy and 
ratio to calculate the fovx and than calculate the points of the view volume?

Is there any way to get and set the camera position without using a 
TrackballManipulator? 


Thank you!

Cheers,
Johannes

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=13627#13627





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to