View Single Post
Old 5th January 2006, 10:34   #19
Kar-mAVS
Member
 
Join Date: Jan 2006
Posts: 56
To rotate an object you do something like this:

Quote:

Frame
rx=rx+rxd;ry=ry+ryd;rz=rz+rzd;

crx=cos(rx);srx=sin(rx);
cry=cos(ry);sry=sin(ry);
crz=cos(rz);srz=sin(rz);

Beat
rxd=rand(100)/10000-0.005;
ryd=rand(100)/10000-0.005;
rzd=rand(100)/10000-0.005;

Pixel

x1=(whatever x is); y1=(whatever y is); z1= (whatever z is)

x2=x1*crz-y1*srz;
y2=x1*srz+y1*crz;

x3=x2*cry+z1*sry;
z3=-x2*sry+z1*cry;

y1=y2*crx-z3*srx;
z1=y2*srx+z3*crx;


z2=1/(z1+2);
x=x3*z2;
y=y1*z2;



here's an example (please don't copy it)

:edit: And try to spell better next time
Attached Files
File Type: zip karmavs - cube.zip (678 Bytes, 525 views)
Kar-mAVS is offline   Reply With Quote