Re: How to Duplicate Nodes?
John Rohlf (jrohlf++at++tubes)
Wed, 22 Feb 95 16:14:31 PST
>
> On Tue, 21 Feb 1995, John Rohlf wrote:
>
> > > I have an application which needs to draw multiple instances of the
> > > same model, but with each instance drawn in a different color.
> > > Unfortunately, I can't seem to use shared or cloned instancing for this,
> > > since color is not an inherited attribute. So I believe I'm stuck
> > > with making a copy of the model for each instance I want to draw, then
> > > setting each leaf node to the desired color. It's ugly, but it might work
> > > if I could figure out how to make copies (short of reading each node's
> > > type and attributes and explicitly re-creating an identical one).
> >
> > pfClone() will copy nodes and children down to pfGeoSets.
> > The pfGeoSets themselves will not be cloned since pfClone() was
> > originally intended as an instancing mechanism where you wanted
> > to share geometry. We hope to clone geosets in 2.0.
> >
> > There are a few ways you can change color between instances
> > through draw callbacks:
> >
> > 1. pfColortable - see man page
> > 2. pfHighlight - see man page
> > 3. pfMaterial with a color mode of PFMTL_CMODE_COLOR will override
> > local pfGeoSet colors.
>
> I have a need to perform a similar operation. In my case it would be for
> a large number of very simple geometry. Does anybody have any data or
> rationale for the performance tradeoffs between actually having duplicate
> pfGeoSets with different colours or using one of the above techniques?
>
None of the above are very slow but if you can afford the
memory go ahead and duplicate the geosets.
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:50:59 PDT