title: Generic Simple 3D Matrix Rotation Issue
body: <p>I have a problem with my rotation on my 3D object (It's in java but it doesn't really matter)</p>
  
  <p>The background:</p>
  
  <p>I have a simple 3d model, and you are a first person player on it, you move your mouse up to look up (I.E Rotate by the 3D's x-axis) and move your mouse down to look down (Rotate in opposite direction)</p>
  
  <p>But:</p>
  
  <p>I also have the left and right arrow keys to turn left/right (Which rotates the 3D's y-axis)</p>
  
  <p>Now the problem is, when I have turned, when I rotate by the x-axis it no longer turns as expected i.e if you turn 180 degrees, by moving your mouse down you actually look up and if you move your mouse up you actually look down.</p>
  
  <p>What rotation can I perform on the x/y axis to fix this?</p>
  
  <p>-So no matter how much/little I have turned, moving mouse up will look up and moving mouse down will look down.</p>
  
  <p>Sorry I can't explain it better, but if you need any more info just make a comment.</p>
  
  <p>Thanks alot,</p>
  
  <p>It's probabaly a simple transformation, but i can't think :(</p>
  
  <p>Some of Java rotation code:</p>
  
  <p>Mouse Up/Down:</p>
  
  <pre><code>  public void rotateXY(double radians, double Yradians)
    {
        vpTrans.getTransform(T3D); 
        Transform3D test = new Transform3D();
        Transform3D testX = new Transform3D();
        Transform3D testY = new Transform3D();
        translate.set(lastXcord, lastYcord, lastZcord);
        testX.rotX(radians);
        testY.rotY(Yradians);
        test.mul(testX, testY);
        test.setTranslation(translate);
        vpTrans.setTransform(test);
        //System.out.println(test);
    } // end of rotateXY()
  </code></pre>
  
  <p>Left: (right is just similar but with minus instead of plus on angle changes)</p>
  
  <pre><code> public void run() {
      Transform3D test = new Transform3D();
      Transform3D rotX = new Transform3D();
      Transform3D rotY = new Transform3D();
  
      vpTrans.getTransform(T3D);
      translate.set(lastXcord, lastYcord, lastZcord);
      angle += 0.05;
      trueangle += 0.05;
      rotX.rotX(angle);
      rotY.rotY(Yangle);
  
      test.mul(rotX, rotY);
  
      test.setTranslation(translate);
      vpTrans.setTransform(test);
  }
  </code></pre>
  
  <p>What transformations/rotations I need to add to that so no matter my y-axis, camera will look up when mouse is moved up and down when mouse is moved down??</p>