From: Marwan B. <La...@fr...> - 2005-12-21 15:55:33
|
Braden McDaniel wrote: > On Tue, 2005-12-20 at 13:33 +0100, Marwan Badawi wrote: > >>Hello all, >> >>I have an application that uses OpenGL to do some pretty low level stuff >>for manipulating geometries (I will pass the details). I would like to >>use an openvrml::gl::browser (or another alternative) to draw vrml >>objects into the already established OpenGL context, using it's >>lighting, viewport, projection and modelview matrices. >> >>What would be the best way to do so? > > > Presumably you mean openvrml::gl::viewer. > > As far as an OpenGL renderer is concerned, openvrml::gl::viewer is all > that OpenVRML gives you. I suspect you could get the functionality you > need by inheriting it and selectively overriding its methods. > > In the worst case (i.e., if you find openvrml::gl::viewer working > against you too much), you can create your own renderer from scratch by > inheriting openvrml::viewer just like openvrml::gl::viewer does. > Yes, you are right. It is actually a openvrml::gl::viewer that I would have to use to draw the contents of a openvrml::gl::browser. With that said, I can't seem to find a way to pass the current OpenGL context to the viewer. Is that even possible? Or does the viewer create it's own context? My problem is, since that I draw other types of objects in my scene (not only VRML), all camera viewpoints, zoom, frustum and lighting settings are already taken care of. All I want to do is draw a vrml object into the alreday existing scene using the already existing context. If the viewer/browser combination allows me to do so, it would be a lot of help. On a small note, I need to render completely static scenes, so no animations. Also support for script nodes is completely unnecessary. I only need to draw the geometry, and nothing else. Don't know if this makes the problem easier to solve. Thank you again, Marwan |