Robert Osfield wrote:
<snip>
> In dev version of the OSG there is a new osgViewer that replaces
> osgProducer are does frame up the frame loop in a convinience method,
> but you also can still call the indivdual traversals if you wish.
> So... if you like high level stuff then perhaps its more to your
> liking:
>
> int main(int, char **)
> {
> // construct the viewer.
> osgViewer::Viewer viewer;
>
> // add model to viewer.
> viewer.setSceneData( osg::readNodeFile("cow.osg" ));
>
> return viewer.run();
> }
>
>
> The run method is a frame driven loop rather than an even driven loop,
> but in principle its kinda similar idea.
Wow! I suddenly realized just how high level OSG can be. Just for
correctness, here's a (non-RSI-afflicted) rewrite:
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
int main(int, char **)
{
// construct the viewer.
osgViewer::Viewer viewer;
// add model to viewer.
viewer.setSceneData( osgDB::readNodeFile("cow.osg" ));
return viewer.run();
}
Compile and link with libosg, libosgDB and libosgViewer and you have a
very nice 3D viewer in just 13 lines of code - including space and comments!
- Ole-Morten
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/