Reputation: 4483
I have a point at 0,0,0 I rotate the point 30 deg around the Y axis, then 30 deg around the X axis. I then want to move the point 10 units forward.
I know how to work out the new X and Y position
MovementX = cos(angle) * MoveDistance;
MovementY = sin(angle) * MoveDistance;
But then I realised that these values will change because of Z, won't they?
How do I work out Z and have I worked out X and Y correctly?
Thanks!
Upvotes: 0
Views: 3241
Reputation: 99535
You should multiply point coordinates to full rotation matrix, which is matRotationTotal = matRotationX * matRotationY * matRotationZ
. Check this article for details.
Upvotes: 2