did they fix multi axis turrets?
oh yea, an excerpts from my matrix class:
mat(double x, double y, double z) //convert eulers to matrix
{
double a,b,c,d,e,f,g,h; //stick our pre-comps into an array //this comment doesn't make any sense!
a = cos(x); b = sin(x);
c = cos(y); d = sin(y);
e = cos(z); f = sin(z);
g = a * d; h = b * d;
c0 = c * e; c1 = -c * f; c2 = d;
c3 = h * e + a * f; c4 = -h * f + a * e; c5 = -b *c;
c6 = -g * e + b * f; c7 = g * f + b * e; c8 = a * c;
}
and
vec operator * (vec &v) //apply to vector
{
return vec(c0 * v.x + c1 * v.y + c2 * v.z,
c3 * v.x + c4 * v.y + c5 * v.z,
c6 * v.x + c7 * v.y + c8 * v.z);
}
give the first function your angles of rotation , i think its in pitch, yaw, roll order. do the math and this will create a 3*3 matrix that represents the full orientation of the object. come up with a vector pointed to 0'0'1 (i think), and do the math in the second function on it (along with the components of the 0'0'1 vector, so v.x and v.y = 0 and v.z = 1). your rotated vector's x'y'z will be the first line, the second and the third respectively. theres other math to gen the side and up vectors, but i dont know it.