Example #1
0
 /**
  * Generates a view matrix for a first person camera looking towards positive-Z by default <br>
  * (Rotations in order Y-X-Z)
  *
  * @param eye position of the camera
  * @param rotation rotation of the camera
  * @return a view matrix representing the camera transformations
  */
 public static Matrix FPViewLH(Vector eye, Vector rotation) {
   Vector rot = new Vector(rotation);
   rot.Y = -rot.Y;
   return Matrix.translate(Vector.mul(eye, -1)).mul(Matrix.rotationZYX(rot));
 }
Example #2
0
 public static Matrix rotationZYX(Vector rotation) {
   return Matrix.rotationZYX(rotation.Z, rotation.Y, rotation.X);
 }