scaling an actor

Charles Law at
Thu Aug 12 07:16:16 EDT 1999


At 05:34 PM 8/11/99 -0400, Mark wrote:
>What is the easiest way to scale an actor?  That is, shrink it or expand it.

actor->SetScale(sx, sy, sz);

>I have tried to implement the example on p. 77 of the VTK textbook in my 
>program to no avail.
>float scale[3];
>vtkTransform *expand = vtkTransform::New();
>    expand->Scale(scale[0], scale[1], scale[2]);
>vtkActor *frameactor = vtkActor::New();
>    frameactor->SetUserMatrix(expand->GetMatrix());
>It complains that the SetUserMatrix is not available or something like 
>that.  What do I do?

Try frameactor->SetUserMatrix(expand->GetMatrixPointer());

But be carefull. Since the assignment is made by reference, further
manipulation of the transform could have unpredictable results
on the actor.

User matrix is one of the few places that does not copy a matrix when it is 
set.  To warn you of this it takes a pointer, and not &vtkMatrix4x4.


This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.


More information about the vtkusers mailing list