On Thu, Apr 8, 2010 at 3:40 PM, Martin Beckett <[email protected]> wrote:

> Is it possible to have a drawable that isn't drawn?
>
> You could subclass Geometry ( I presume that's what you're actually using),
but...

> I have a complex object split into a number of geodes but sharing a common
> vertex array - this is necessary because some of the meshes combine across
> objects.
>
> I presume you mean that the common vertex array(s) is shared among several
Geometry objects, which are the children of Geodes?

> But I do need a way of quickly knowing if a particular vertex is in a
> certain geometry from the primitiveIndex returned by a pick.
> If they were just points this is easy - because the vertices are in order
> (ie, first N are in first geometry, next M are the 2nd etc)
> But there is no easy way to count how many points are in a line or triangle
> geometry.
>
> If you have one big shared vertex array, then you can look at the
PrimitiveSet objects in the containing Geometry in order to get the mapping
from primitive index to actual index in the vertex array. Assuming that you
are not doing anything exotic, you can dynamic_cast the Drawable returned in
the intersection report to a Geometry.

> I thought of having a drawarray of points for each part but somehow setting
> it to not actually draw them as points - is there any way to achieve this?
>
> The alternative is to have a vertexattribute but this seemed a bit over
> kill if I only read need to store a few indices.
>
>
> Cheers,
> Martin
>
Tim
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to