|
|
#1 |
|
not fucked, not quite.
(Forum King) |
Rotation
I was wondering if anyone could post a movement code for rotation.
|
|
|
|
|
|
#2 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Mmmm this needs to become a FAQ. Basic rotation goes like this:
x' = x*cos(a) - y*sin(a); y' = x*sin(a) + y*cos(a); where a is the angle in radians. This rotates the point (x,y) around the origin to become (x',y'). To rotate around a different point, first translate the point so that the rotation center is the origin, and then translate back again. For 3D, you can rotate around the 3 axes by using (x,y), (x,z) or (y,z) as the coordinates in the formula above. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|