Rotate Point3D around Unit Vector

1.6k views Asked by At

as an Image above

enter image description here

i want to rotate the point P1 around unit vector RotationAxis (Red vector in Image and its in Center).

in my program (WPF) i Have a Quaternion and a 3DPoint.

How can i rotate the Point P1?

i tried Matrix rotation but it rotates nothing.

Matrix3D matrix = Matrix3D.Identity;
matrix.Rotate(RotationAxis); //RotationAxis is Quaternion
matrix.Transform(point3D); // point3D is Point3D that i want to rotate around RotationAxis
1

There are 1 answers

0
M.kazem Akhgary On BEST ANSWER

The problem was that i didnt save the result of Matrix Transform

point3D = matrix.Transform(point3D); // now point3D rotates as it should be