Need Help with 3D rotations
I use the following:
- Around X axis
y1:=cbuffer.Y*Cos(xang)-cbuffer.z*sin(xang);<BR>z1:=cbuffer.Y*Sin(xang)+cbuffer.z*cos(xang);<BR>cBuffer.Y:=y1;<BR>cBuffer.Z:=z1;<P>and soon…<P>FlyFire/CodeX<BR> <A HREF="http://codexorg.webjump.com" TARGET=_blank>http://codexorg.webjump.com</A>
http://codexorg.webjump.com
X:
-----
temp_y = (rect_3d.vert.y*cos(x_ang)) + (rect_3d.vert.z*sin(x_ang));<BR> temp_z = (rect_3d.vert.y *-sin(x_ang)) + (rect_3d.vert.z*cos(x_ang));<BR> <BR> rect_3d.vert.y = temp_y;<BR> rect_3d.vert.z = temp_z;<P>Y:<BR>—–<BR>temp_x = (rect_3d.vert.x*cos(y_ang)) + (rect_3d.vert.z*-sin(y_ang));<BR> temp_z = (rect_3d.vert.x *sin(y_ang)) + (rect_3d.vert.z*cos(z_ang));<BR> <BR> rect_3d.vert.x = temp_x;<BR> rect_3d.vert.z = temp_z;<P>Z:<BR>—–<BR>temp_x = (rect_3d.vert.x*cos(z_ang)) + (rect_3d.vert.y*sin(z_ang));<BR> temp_y = (rect_3d.vert.x*-sin(z_ang)) + (rect_3d.vert.y*cos(z_ang));<BR> <BR> rect_3d.vert.x = temp_x;<BR> rect_3d.vert.y = temp_y;<P>——–<BR>Any help would be appreciated, and yes i know i should use matrices.<BR>