   Floating point inaccuracy in matrix rotation?
  Hey again.  Just as soon as I get my quaternion class working I realize that I don''t - *gasp* - really need it, so why mess around with something I only vaguely understand?  So I wrote a camera class that works quite well using only matricies.  However, it seems like I''m getting some sort of inaccuracy somewhere while compiling my rotation matrix.  When I run the program, my camera starts at 0,0,-5 looking at a triangle at the origin.  I then rotate around the x axis to look up at the triangle (0,-5,0 - close, but not -5 as wierd things happen when you are immediately below an object).  This operation works fine.  Then I rotate about the y-axis using the following function:    void CAMERA::rotatecameray(float theta) {thetay+=theta;if(thetay > 359.0f)thetay = 0.0f;theta /= 57.2957795f;float c = (float)cos(theta);float s = (float)sin(theta);float t = 1.0 - c;float vals[16] = {t * up.x * up.x + c, t * up.x * up.y - s * up.z, t * up.x * up.z + s * up.y, 0,t * up.x * up.y + s * up.z, t * up.y * up.y + c, t * up.y * up.z - s * up.x, 0,t * up.x * up.z - s * up.y, t * up.y * up.z + s * up.x, t * up.z * up.z + c, 0,0,0,0,1};rotation.accept(vals); // just sets up the matrixposition = rotation * &position   up.x = (float)sin(roll);up.y = (float)-cos(roll);up.z = 0;towards.x = position.x - focus.x;towards.y = position.y - focus.y;towards.z = position.z - focus.z;Normalize(towards);right = CrossProduct(up, towards);Normalize(right);up = CrossProduct(right, towards);float rot[16] = {right.x, right.y, right.z, 0,up.x, up.y, up.z, 0,towards.x, towards.y, towards.z, 0,0,0,0,1};rotation.accept(rot);float tra[16] = {1,0,0, -position.x,0,1,0, -position.y,0,0,1, -position.z,0,0,0, 1};translation.accept(tra);final = rotation * translation;}   // final is the matrix that we give to opengl after transposing itThe triangle rotates perfectly for a few frames, then slowly the camera begins rotate back around the x-axis to return back to (x, 0, z).  I''ve caught the multiplication matrix a few times (rotation) and here''s the result of a frame rotating by 1 degree: 0.999848, 0.017450,-0.000305, 0.000000-0.017450, 0.999848, 0.000003, 0.000000 0.000305, 0.000003, 1.000000, 0.000000 0.000000, 0.000000, 0.000000, 1.000000Is there something wrong with my calculations or is it just floating point inaccuracy?_Sky_Fire_ 