[vtkusers] How to making an object hierarchy ?

David.Pont at ForestResearch.co.nz David.Pont at ForestResearch.co.nz
Tue Feb 4 15:46:43 EST 2003


Hi Nick,
   vtkAssembly supports recursive grouping. So If you have created actors
for the parts: 2 fingers - hand - forearm - arm - torso,  you should be
able to do:

assemblyHand->AddPart( actorHand )
assemblyHand->AddPart( actorFinger1 )
assemblyHand->AddPart( actorFinger2 )

assemblyForearm->AddPart( actorForearm )
assemblyForearm->AddPart( assemblyHand )

assemblyArm->AddPart( actor->Arm )
assemblyArm->AddPart( assemblyForearm )

assemblyTorso->AddPart( actorTorso )
assemblyTorso->AddPart( assemblyArm )

To move a finger apply a transform directly to its actor, no need for an
assembly at the lowest level. To move other parts apply a transform to the
appropriate assembly (not the actor).

  Dave Pont



|--------+--------------------------------->
|        |          "N.Tsagarakis"         |
|        |          <n.tsagarakis at salford.a|
|        |          c.uk>                  |
|        |          Sent by:               |
|        |          vtkusers-admin at public.k|
|        |          itware.com             |
|        |                                 |
|        |                                 |
|        |          05/02/2003 08:51       |
|        |                                 |
|--------+--------------------------------->
  >------------------------------------------------------------------------------------------------------------|
  |                                                                                                            |
  |      To:     <vtkusers at public.kitware.com>                                                                 |
  |      cc:                                                                                                   |
  |      Subject:     [vtkusers] How to making an object hierarchy ?                                           |
  >------------------------------------------------------------------------------------------------------------|




Hi everybody

I am inerested in building a robot arm simulator using the VTK.

To make the different part of the arm to move together I tried to use the
vtkAssemby node
However I realised that although the different parts of the arm are now
move together when I move the
assembly, when I tried to rotate an intermidiate object (lets say the elbow
joint) in the assembly hierarchy the object was rotating
independently from the rest of the assembly's objects.

Can anyone know how to make in VTK 3D an object hierarchy where the motion
or rotation of any object in the hierarchy tree affects
the objects that are below the moving object ?



Nick










More information about the vtkusers mailing list