Example #1
0
 /**
  * The simplest perspective projection matrix that makes inverting the complete world to screen
  * matrix easy.
  */
 private static Matrix createProjectionMatrix() {
   return Matrix.create4x4(
       1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0);
 }
Example #2
0
  /**
   * Constructs a 4x4 matrix representing the complete transform from real world coordinates to
   * screen space coordinates.
   */
  Matrix toProjectionMatrix() {
    Matrix transform = Matrix.create4x4(position.negate(), rotation);

    Matrix result = Matrix.multiply(createProjectionMatrix(), transform);
    return result;
  }