Rotate VtkImatgePlanWidget With vtkLineWidget

Hi
I Trying To Rotate VtkImagePlanWidget With VtkLineWidget
I Create VtkImage Plan Widget And Vtk Line Widget
And Set Event On Vtk Line Widget

 vtkPlaneSource ps = vtkPlaneSource.SafeDownCast(planeWidget.GetPolyDataAlgorithm());
     
 ps.SetNormal(Point2[0] - Point1[0] , Point2[1] - Point1[1] , Point2[2] - Point1[2] );
 ps.SetCenter(Point1[0], Point1[1], Point1[2]);
       
planeWidget.UpdatePlacement();

I Get Plan Source And Set Normal And Set Center
Point 1 its center
but plan its vertical on Line but I need Plan On Line Set

I Rotating Plan Line White with Green Line Widget And Plan Its Vertical On Green Line

I need any Data About Set Origin And Set Normal And Set Center And Best Way To Use This Method
in My Problem.

I would appreciate any help you can give me

If you’re trying to rotate a plane, you’re essentially rotating the normal of the plane. In the case that you already know the line widget’s endpoints, you can directly set the line widget vector (normalizes) as the normal for the plane.

Hi sankhesh

I Have Three Point First, End And Center
How Can Normalizes For Normal Plan With This Points

Thank you for giving me an explanation about this

@m.h.shanazary I assume you mean you have three points on the line segment. In that case, just choose any two points and calculate the vector (p1 - p0) and normalize it. The direction of the vector would depend on which points you choose as p1 and p0.

Thanks For Help