Hi Robert -- Just a further prod on this topic... What CopyOp would I use to
copy a Geode such that I get actual copies (deep copies) of everything but
the arrays (I want references, or shallow copies, of the arrays)?
 
In other words, say I load a .osg file that is a Geode with a single
Geometry, and the Geometry has vertex/index/normal arrays, and an overall
color. So now I'd like to draw several instances of this in my scene, but
I'd like each to use different colors. So I figure I should make a copy such
that the Geometry in the copy has references back to the original
vertex/index/normal/color arrays, then replace the reference to the color
array with a new color array. This would give me what I want: a copy that
shares all the vertex/index/normal data, but has its own unique color array.
 
I tried clone(~osg::CopyOp::DEEP_COPY_ARRAYS), but this produced the same
results as DEEP_COPY_ALL -- it gave me deep copies of the arrays, rather
than references. I also tried using ~DEEP_COPY_DRAWABLES, but this gave me a
reference to the Geometry, which is not what I wanted.
 
In short, there's no way that I can see to copy a Geode that gives me new
Geode and Geometry instances, but has references back to the original array
data.
 
Thanks,
Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com <http://www.skew-matrix.com/> 
303 859 9466
 
 



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Robert Osfield
> Sent: Friday, December 01, 2006 6:23 AM
> To: osg users
> Subject: Re: [osg-users] shared VertexArray in Geometries
>
> Hi Sohel,
>
> Yes you can share vertex arrays between osg::Geometry.
>
> On 12/1/06, Soheil Sotoodeh <[EMAIL PROTECTED]> wrote:
> > Hi everyone,
> >
> > Can I share a vertex array (only the vertexArray) of a geometry
> > between some other geometries ?
> >
> > e.g. if I have a mesh and I've built an octree over it. I've made a
> > Geometry (let's name it geom_vertices) contains all the
> points and I
> > want to make a Geode for each octree's node as well as a
> geometry for
> > each of the geodes (name it as octree_node_geom). But I
> want to have
> > for each node's geometry
> > (octree_node_geom) only indices to the geom_vertices and
> not copy the
> > vertices in each.
> >
> > It is mainly necessary if I want to render objects (facets)
> which are
> > intersecting more than one octree nodes.
> >
> > I appreciate your replies.
> > Cheers,
> > Soheil
> >
> >
> >
> >  ________________________________
> > Want to start your own business? Learn how on Yahoo! Small Business.
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
> . 

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to