예제 #1
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 /**
  * 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 pitch rotation around X
  * @param yaw rotation around Y
  * @param roll rotation around Z
  * @return a view matrix representing the camera transformations
  */
 public static Matrix FPViewLH(Vector eye, double pitch, double yaw, double roll) {
   return Matrix.translate(Vector.mul(eye, -1)).mul(Matrix.rotationYXZ(-yaw, pitch, roll));
 }
예제 #2
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 public static Matrix rotationYXZ(double yaw, double pitch, double roll) {
   return Matrix.rotationY(yaw).mul(Matrix.rotationX(pitch).mul(Matrix.rotationZ(roll)));
 }
예제 #3
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 /**
  * 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));
 }
예제 #4
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 public Matrix mul(Matrix other) {
   this.setData(Matrix.mul(this, other));
   return this;
 }
예제 #5
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 public static Matrix rotationXYZ(Vector rotation) {
   return Matrix.rotationXYZ(rotation.X, rotation.Y, rotation.Z);
 }
예제 #6
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 public static Matrix rotationZYX(Vector rotation) {
   return Matrix.rotationZYX(rotation.Z, rotation.Y, rotation.X);
 }
예제 #7
0
파일: Matrix.java 프로젝트: qhadron/QHLib
 public static Matrix rotationZXY(Vector rotation) {
   return Matrix.rotationZXY(rotation.Z, rotation.X, rotation.Y);
 }