[osg-users] Draw geometry on demand

Robert Osfield robert.osfield at gmail.com
Sun Jun 10 23:39:57 PDT 2018

HI Tyler.

> I like to know how to redraw geometry on demand.
> I have a osg:geometry with attached VertexArray and PrimitiveSet.
> I need to send draw command to redraw geometry.
> I see there is a "draw" method in DrawElements class, but that wants
> an osg::State that i dont know how to get.
> Or alternatively is there any other procedure how to do that, like some UpdateCallback?
> Can anyone help me?

You don't normally draw "on demand" with a scene graph, it's purpose
is to manage the culling and draw dispatch for you.

There are times when you can manage low level rendering, but this
tends to be niche task done for very specific techniques, it's
something I'd expect advanced users might consider occasionally, but
for the most part users will likely never call the low level draw code

Could you take a step back and explain what you are trying to do at a
higher level.  I suggest this as there may well be a much more
straight forward way of doing things that starting to get your hand
dirty with low level stuff.


More information about the osg-users mailing list