> If you want to go straight to specific index then you'll need to cast the
> drawable
> to osg::Geometry and walk through the PrimitiveSet's yourself.
So, suffice it to say that:
myPrimitiveSet.accept( myFunctor );
Is basically shorthand for "run the entire primitiveset through this functor"
and
it's not designed to be more specific than per-PrimitiveSet (or per-Geometry)?
So, in order to get a *specific* primitive, I'd need to do the walking as you
mentioned or (in theory) develop a means of using accept( ) on a per-primitive
basis (see related Q at end of post, if interested).
> Be perpared to have to learn quite a bit about how flexible OpenGL can
> be w.r.t how it represent primitives.
Yeah :-$ I'm there right now. Ignoring "how" to get there, the destination
I am looking for is essentially:
"See the 10th primitive in the 3rd set under this Geometry? Tell me about it"
and I get back the vertices, normals, colors, etc.
But you're right... just the fact that colors can be embedded in 3 different
ways and with 5 different bindings does complicate the code.
Thanks,
Bill Prendergast
- - - - -
* related Q from above
I tried to use the functor's vertex() call:
virtual void vertex(unsigned int vert) {
_indexCache.push_back(vert);
}
Since it's virtual, I created a version specific to my TriangleIndexFunctor
attempting to _indexCache ONLY the vertex I was interested in. So at
the end( ) call, the _indexCache would have just the starting vertex I wanted,
not the whole set. end() would then call drawElements(), which in turn would
call my operator() but slightly more efficiently, because ONLY the vertex in
question would be handled.
FWIW, the TriangleIndexFunctor's vertex() appeared never to be called.
I have yet to dig deeper to fully understand how the Functor's begin(),
vertex(), and end() functions are supposed to work.
I guess my Q is: Was I even close here with this approach?
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/