Hi Andrew,

You could use Drawable::DrawCallback and override the rendering of
your mesh and implement your own code for hiding/displaying different
sets of primitives.  However, as you mention,
osg::Geometry::drawImplementation() is actually pretty complicated so
reproducing this then making it even more complicated with the
optional primitive set rendering would be be rather daunting.

In the svn/trunk version of osg::Geomtry::drawImplemtation() the code
has been rewritten completely and is actually far more straight
forward and readable - all achieved by using a couple of helper
classes.  This would certainly be the easier base to use, with the
helper classes being reusable directly.

The other approach would be just manage the osg::Goede + osg::Geometry
so that the different sets of primitives can be turned on/off via
NodeMasks combinations.  To help simplify management you could write a
custom osg::Node/osg::Group that automatically manages an internal
scene graph that hides the complexity of all the separate
osg::Geometry.

Robert.

On Mon, Dec 7, 2009 at 2:56 AM, Andrew Cunningham <o...@a-cunningham.com> wrote:
> I want to do something a little 'odd' and am not sure of the best way to do 
> this.
> - assuming a 'large' number of (tri or quad) primitives in a primitiveset 
> (say 100K-500K+) I want to hide ( not draw)  a user-defined subset of those 
> primitives.
>
> - the user scenario is that the user selects a subset of primitives from the 
> full geometry then "hides" them. The user can also "Un-hide" any hidden 
> primitives at any time.
>
> - I could laboriously keep multiple geometries but was wondering if it is 
> possible to override one of the drawing functions to "test" for membership in 
> a hidden set for each primitive. Obviously this would follow the slow path, 
> Or ???. I have looked at the primitiveset drawing code but got lost in the 
> complexity of VBO vs displaylist vs slow path etc.
>
>
> Thanks
> Andrew
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=20989#20989
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to