Click here to Skip to main content
15,942,710 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can you show me how to rotate a Point3D @ angle X around an axis at a desired Point3D?

For example, I have a Point3D p1(10,0,0);
and I would like to rotate it 45 degrees in Z axis and has to be rotate centered at (10,0,0).

Any help is appreciated.
Thanks
Posted

1 solution

Hello,

Look at the RotateTransform Class.
http://msdn.microsoft.com/en-us/library/system.windows.media.rotatetransform%28v=vs.110%29.aspx[^]


There's an example at the bottom of the page.

Valery
 
Share this answer
 
Comments
Jaxam 13-Feb-14 15:40pm    
like this would work?

Point3D pt = new Point3D(10, 0, 0);
RotateTransform3D myRotateTransform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 0, 1), 45));
Point3D ptR = myRotateTransform.Transform(pt);
Jaxam 13-Feb-14 15:42pm    
of course i forgot to add the myRotateTransform.centerX Y and Z

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900