Hi all,
I am a beginner of OSG and just learnt the method of setViewport(). Then I try
to test it in a very simple program which code is like following:
#include <osg/...> // here includes the nessesary files
int main( int argc, char** argv )
{
osg::ref_ptr<osg::Node> model1 = osgDB::readNodeFile("cessna.osg");
osgViewer::Viewer viewer;
viewer.setSceneData( model1.get() );
viewer.getCamera()->setViewport(new osg::Viewport(0, 0, 140, 30));
return viewer.run();
}
when running the program above I found the line of
"viewer.getCamera()->setViewport(new osg::Viewport(0, 0, 140, 30));" actually
does not work. The model is displayed in the area of the full screen. Even I
tried other values to set the viewport position and size the result remains the
same. Seems the line does not take any effect. Why?
Really wonder about this, can anybody tell me the reason? Thanks a lot!
Best regards,
Jack
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org