Specifying drawing types
The next step after setting vertex attribute arrays is to tell the osg::Geometry
object how to render them. The virtual base class osg::PrimitiveSet
is used to manage a geometry primitive set which records the rendering order information of vertices. The osg::Geometry
provides a few public methods to operate on one or more primitive sets:
- The
addPrimitiveSet()
method takes anosg::PrimitiveSet
pointer as the parameter and attaches a primitive set to theosg::Geometry
object. - The
removePrimitiveSet()
requires a zero-based index parameter and the number of primitive sets to remove. It will remove one or more attached primitive sets. - The
getPrimitiveSet()
returns theosg::PrimitiveSet
pointer at the specified index. - The
getNumPrimitiveSets() ...
Get OpenSceneGraph 3.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.