[vtkusers] newbee question: Combining Primitives ala VRML PROTO

Iain Young iain at g7iii.demon.co.uk
Wed Nov 12 15:21:54 EST 2003


Hi All,

I've tried seaching the archives, and looked thru the alphabetical
list of classes, and not found anything appropriate, so apologies
if the answer is there, and I just can't find it.

What I'm trying to do is combine already defined objects. What I
have is a hexagon with the 6 sides, and a top & bottom, defined
using vtkPoints and vtkPolygon.

What I want to do is combine all these 8 objects into (for want of
a better word), a single meta-object, so I can use the rotate
functions to rotate all the induvidual elements as one.

(In VRML I would just define a PROTO and instansiate<sp> each
part, then instansiate<sp> the PROTO, then apply a translation
to it)

How can I do the same thing using VTK ? Anyone have any example
code ? Preferably using the TCL bindings ? :)

(This is to model a how a spacecraft in orbit looks from the
ground, so the ability to rotate all the spacecraft parts in all
3 dimensions would be really usefull)

(Yes, If I really need to, I can rotate the camera, but that is
an extra complexity, as I have to calculate the reverse angles,
and I have to take into account the camera location.)


All the Best

Iain



More information about the vtkusers mailing list