Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Rotation of a point in 3D

This topic is 6194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok I have 1 point lets say x=0 y=1 z=0 so its farlly simple I want to rotate this point around the x axis by 90 degrees this would put it at x=0 y=0 z=1, correct? what equation could I use to use to do this kind of rotaton. equations for all axes please. It has to be done by me, I can''t use a API command, just if anyone whats to respond with that. Sorry if I sound a bit demanding but I have wasted lots of time seaching for the answer on the internet, I found nothing. thanks

Share this post

Link to post
Share on other sites
It looks like you''re using a right hand coordinate axis. Lets say you have a point P1(x1, y1, z1).

Rotating P1 counterclockwise by an angle A around the x axis when looking from the positive x axis gives a point P2(x2, y2, z2) where
y2 = y1*cos A - z1*sin A
z2 = z1*cos A + y1*sin A

rotating around y axis
z2 = z1*cos A - x1*sin A
x2 = x1*cos A - z1*sin A

rotating around z axis
x2 = x1*cos A - y1*sin A
y2 = y1*cos A + x1*sin A

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!