OSG isn't really designed to be used as just a dumb model loader and rendered. It's a scene graph, so it has facilities for doing things you would do in a scene graph, like culling, for example. You could, in theory, write a NodeVisitor to traverse the scene graph and render the Drawables. However, you would almost certainly need to handle state and transformations encoded in the scene graph by the model loader. It'd be easier for you to use the osgUtil::SceneView class. Attach your loaded model, then call SceneView update(), cull(), and draw() each frame. There are some gotchas with this approach, but this seems like the least invasive way for you to proceed. Unfortunately, SceneView will be deprecated in a future OSG release. When I first started integrating OSG with an application at my former employer, we elected to use the SceneView route, so I'm familiar with the bumps you might run into along the way. Feel free to post back if you encounter issues. -Paul
_____ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of martin rogers Sent: Monday, July 16, 2007 4:36 AM To: [email protected] Subject: [osg-users] Using OSG just for model rendering Hi All I'm a bit new to OSG and I've not managed to find anything coming close to what I'd like to do in the archives so I thought I might post here and see what you guys think! I have an application that is written purely in OpenGL, and I have the need to load a few simple models into the scene. I'm wondering if I can make use of OSG purely to load the model and render it when required, I don't really want to do anything more elaborate than that. I notice that the osg::drawable class has a draw method, so I'm thinking that in my app when I'm doing my GL stuff, I should traverse the graph from the node that is returned from loading the file, looking for these osg::drawable nodes then calling the draw function. Am I going about this the right way? Any feedback most welcome! Martin _____ Are you the Quizmaster? Play BrainBattle with a friend now! <http://specials.uk.msn.com/brainbattle>
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
