Archive: How do I rotate somthing on the y-axis?


7th December 2001 21:07 UTC

How do I rotate somthing on the y-axis?
How do i rotate somthing on the y-axis?


8th December 2001 02:40 UTC

3D?
If you mean 3D, the formula is (in matrixform):

[ x' ]   [ c  0 s 0 ] [ x ]
[ y' ] = [ 0  1 0 0 ] [ y ]
[ z' ]   [ -s 0 c 0 ] [ z ]
[ 1  ]   [ 0  0 0 1 ] [ 1 ]


With c and s being the cosine and sine of the angle to rotate.
If you don't know matrixmath, the formula above expands into:

x' = c*x + s*z;
y' = y;
z' = -s*x + c*z;


8th December 2001 03:22 UTC

Re: 3D?

Originally posted by UnConeD
If you mean 3D, the formula is (in matrixform):

[ x' ]   [ c  0 s 0 ] [ x ]
[ y' ] = [ 0  1 0 0 ] [ y ]
[ z' ]   [ -s 0 c 0 ] [ z ]
[ 1  ]   [ 0  0 0 1 ] [ 1 ]

take off the 4th rows and columns :p

8th December 2001 15:16 UTC

I used homogenous coordinates which are more common in 3D because you can write any transformation with them... (e.g. translation is a 4x4 with the last column being the 3 coordinates of the new origin and a 1.) The last coordinate should probably be t' and t, but I wrote 1 to show that it's of no significance here.