I'm using OpenGLContext to load a VRML file into a SceneGraph object. Unfortunately, for the life of me I can't find any example showing how to render the SceneGraph.
I've created a context with testcontext.getInteractive()
, but now what? How do I render a SceneGraph?
It's quite poorly documented. All that needs to be done is create a context class and set its sg
field, like so:
def MyContext(BaseContext):
def OnInit(self):
self.sg = ... load your scene graph here ...
def OnRender(self, mode):
return
And that's it, the scene is rendered properly.
Take a look at:
http://pyopengl.sourceforge.net/context/tutorials/shader_1.xhtml
It steps you through the process with some thorough explanations.