[osg-users] Efficient way to swap colors

Antoine Rennuit antoinerennuit at hotmail.com
Tue Sep 5 09:31:11 PDT 2017


Hello all

I have a mesh (a osg::Geometry) which I would like to change color depending on the mode it s in:

	 osg::Geometry all white by default

	 osg::Geometry all blue when selected



In order to achieve this I thought of using the BIND_OVERALL mode with 2 Vec3Arrays (one array for the white color and the other one for the blue color) and simply swapping arrays to change the color (with osg::Geometry::setColorArray()), and calling dirtyDisplayList() to update.

Is this the most efficient way of changing the osg::Geometry color?

Thanks a lot,

Antoine[/list][/list]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=71629#71629







More information about the osg-users mailing list