OpenGLContext is currently using GLU quadrics to render the various VMRL quadric primitives. There's no particular reason to do so other than it was easy and simple to implement. I've just written up some code to generate two VBO-compatible arrays that render a sphere with a given angular resolution as a single glDrawElements call (once the arrays are bound/enabled).
Why does that matter? Well, many PyOpenGL projects are actually molecular visualization tools, so there tends to be a *lot* of spheres. Having sample code that can render spheres at a reasonable clip will probably be useful at some point :) .
Haven't integrated the code into the scenegraph package yet, but that's a pretty trivial change. One thing I should look into is providing a transparency-sorted render path as well, though that would impact performance.
The cone and cylinder are comparatively trivial to implement, though the natural implementations would be to have two calls for cone and 3 for cylinder. IIRC using degenerate triangles and a single triangle strip is a suggested path for quadric rendering... may look into that.
Pingbacks are closed.