[vtkusers] transforms within an assembly

David J. Netherway djn at elan.mad.adelaide.edu.au
Sat Jul 15 23:31:24 EDT 2000


Hello,

I create a 3D marker with arms in the X, Y and Z directions positioned
at x, y, z.

The following code used to create the correct assembly to be positioned
as needed.
But using a recent download of a few nights ago this no longer works.

The arms are now rotated (I think) around the global origin and not the
assembly origin
positioned at x, y, z as they were previously.

There were some changes made to transforms a month or so ago and this
may be related.

Any suggestions?

I could individually code each arm but I would rather understand the
transform order and relationships.

Thanks, David

#---------Create Marker------------------------
vtkCubeSource markerXArm
  markerXArm SetXLength 8
  markerXArm SetYLength 1
  markerXArm SetZLength 1
  markerXArm SetCenter  12 0 0

vtkPolyDataMapper mapperMarkerXArm
    mapperMarkerXArm SetInput [markerXArm GetOutput]

vtkCubeSource markerCentre
vtkPolyDataMapper mapperMarkerCentre
    mapperMarkerCentre SetInput [markerCentre GetOutput]
vtkActor actorMarkerCentre

vtkActor actorMarkerArm0
vtkActor actorMarkerArm1
  actorMarkerArm1 RotateZ  90
vtkActor actorMarkerArm2
  actorMarkerArm2 RotateZ 180
vtkActor actorMarkerArm3
  actorMarkerArm3 RotateZ 270
vtkActor actorMarkerArm4
  actorMarkerArm4 RotateY  90
vtkActor actorMarkerArm5
  actorMarkerArm5 RotateY -90

vtkAssembly actorMarker
  actorMarkerCentre SetMapper mapperMarkerCentre
  actorMarker AddPart actorMarkerCentre
  foreach arm {0 1 2 3 4 5} {
    actorMarkerArm$arm SetMapper mapperMarkerXArm
    actorMarker AddPart actorMarkerArm$arm
    actorMarkerArm$arm PickableOff
  }
actorMarker PickableOff
#-----------------------------------------

The marker is positioned using the following call:
actorMarker SetPosition $x $y $z






More information about the vtkusers mailing list