3D rotation
--
Sengir
you can perform all this in one transformation step through matrices, and you _must_ du that with openGL.
Sengir
--
Sengir
mx[0] = 1;mx[4] = 0;mx[8] = 0;mx[12] = 0;
mx[1]=0;mx[5]=cos(x);mx[9] = sin(x);mx[13]=0;
mx[2]=0;mx[6]=-sin(x);mx[10]=cos(x);mx[14]=0;
mx[3]=0;mx[7]=0;mx[11]=0;mx[15] = 1;
glMultMatrixd(mx);
mx[0]=cos(y);mx[4]=0;mx[8]=-sin(y);mx[12]=0;
mx[1]=0;mx[5]=1;mx[9]=0;mx[13]=0;
mx[2]=sin(y);mx[6]=0;mx[10]=cos(y);mx[14]=0;
mx[3]=0;mx[7]=0;mx[11]=0;mx[15]=1;
glMultMatrixd(mx);
mx[0]=cos(z);mx[4]=sin(z);mx[8]=0;mx[12]=0;
mx[1]=-sin(z);mx[5]=cos(z);mx[9]=0;mx[13]=0;
mx[2]=0;mx[6]=0;mx[10]=1;mx[14]=0;
mx[3]=0;mx[7]=0;mx[11]=0;mx[15]=1;
glMultMatrixd(mx);
and then just call glTranslated to move it to where I want it to be. Or do I have to do they rotations with out calling glMultMatrix, and multiply the vertices by the rotation matrix by hand? If no, I guess my next question, is how do I know how much the object needs to be translated by.
thanx for all the help, I'm a little new to 3d (can u tell)