vtkPlane and vtkPlaneSource => clippingplane
Jorrit Schaap
jorrit at lkeb.azl.nl
Fri Oct 8 10:48:35 EDT 1999
Dear VTK Users,
In short my question is as folows:
I have:
vtkPlaneSource *planeSource = vtkPlaneSource::New();
vtkPolyDataMapper *planeMapper = vtkPolyDataMapper::New();
planeMapper->SetInput(planeSource->GetOutput());
vtkActor *planeActor = vtkActor::New();
planeActor->SetMapper(planeMapper);
after some rotations (done by an interactor) i want to get the normal of
this plane.
Can somebody please give me a hint on how to do that?
Thanks.
Jorrit Schaap.
Here below is my problem in some more detail (for the die-hards)
I am using a clipping plane as follows:
vtkPlane *clippingPlane = vtkPlane::New();
clippingPlane->SetOrigin(x, y, z);
clippingPlane->SetNormal(n1, n2, n3);
aMapper->AddClippingPlane(clippingPlane); this is some mapper in my
pipeline
this works very good.
Next I tried to make a new vtkInteractorStyle, derived from the
vtkInteractorStyleTrackball, and called it
vtkInteractorStyleClippingPlane.
I overloaded the OnTimer function, and added the functions
TrackballPanClippingPlane and TrackballRotateClippingPlane. In the Pan
function i set the origin of the clippngplane, and this works very nice.
But, in the Rotate function i want to set the normal of the
clippingplane, and i can't figure out how to calculate the new normal
based on the mousemovement.
Here is what i tried: I copied the code from the function
vtkInteractorStyleTrackball::TrackballRotateActor, and replaced the
InterActionActor with a vtkPlaneSource...vtkPolyDataMapper...vtkActor.
(as above) This enables me to rotate the polydata plane.
Now here is my question: how can i get the normal of this polydata
plane?? (so i can use this normal to set the normal of the
clippingPlane).
Thanks again for reading this long story.
Jorrit
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list