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:

  1. The addPrimitiveSet() method takes an osg::PrimitiveSet pointer as the parameter and attaches a primitive set to the osg::Geometry object.
  2. 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.
  3. The getPrimitiveSet() returns the osg::PrimitiveSet pointer at the specified index.
  4. 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.