[vtkusers] orientation arrow on vtkImagePlaneWidget

Dean Inglis dean.inglis at sympatico.ca
Fri Feb 9 19:21:44 EST 2007


Nada,

you can retrieve the position/orientation of an oblique widget plane using
GetPoint1, GetPoint2,
GetOrigin, or GetNormal, GetCenter, also
GetVector1, GetVector2 which correspond
to:

double* p1 = widget->GetPoint1();
double* p2 = widget->GetPoint2();
double* o = widget->GetOrigin();
double* v1 = widget->GetVector1();
double* v2 = widget->GetVector2();
double* n = widget->GetNormal();

also,

v1 = p1 - o
v2 = p2 - o
n = (v1 x v2) / ||v1 x v2||

(x = cross-product, ||.|| = euclidean norm)

regards,
Dean


Hi
I'm using three vtkImagePlaneWidgets for MPR and want to show the users
which side of the plane they're looking at by introducing arrows in the
middle of each plane.  I'm using a cone and a cylinder to create each arrow,
so I rotate them to point towards the plane.  I can initially orient them
correctly, and with the X and Y planes, this is sufficient, as I have
them constrained to their axes. However, I am allowing the user to rotate
the Z plane freely and cannot get the arrows to follow. I'm not sure if it
makes more sense to do this during the creation of the arrow or by rotating
it at the end. Any suggestions?
Thanks,
Nada




More information about the vtkusers mailing list