Package org.lwjgl.util.vector

Examples of org.lwjgl.util.vector.Matrix4f


   * @param fov The field of view in degrees
   * @param aspectRatio The aspect ratio
   * @return This matrix for the purpose of chaining methods together. */
  public static Matrix4f setToProjection (Matrix4f m, float near, float far, float fov, float aspectRatio) {
    if (m==null)
      m = new Matrix4f();
    m.setIdentity();
    float l_fd = (float)(1.0 / Math.tan((fov * (Math.PI / 180)) / 2.0));
    float l_a1 = (far + near) / (near - far);
    float l_a2 = (2 * far * near) / (near - far);
    m.m00 = l_fd / aspectRatio;
View Full Code Here


   
    this.draw_glsl(mat, this.getModelMatrix());
  }
 
  public Matrix4f getModelMatrix() {
    Matrix4f mat4 = new Matrix4f();
    mat4.setIdentity();
   
    mat4.translate(new Vector3f(0,0,0));
    mat4.scale(new Vector3f(1,1,1));
   
    return mat4;
  }
View Full Code Here

    this.VBO.flip();
    this.tri_vertcount = this.VBO.capacity();
  }
 
  public Matrix4f getModelMatrix() {
    Matrix4f mat4 = new Matrix4f();
    mat4.setIdentity();
   
    mat4.translate(new Vector3f(0,0,0));
    mat4.scale(new Vector3f(1,1,1));
   
    return mat4;
  }
View Full Code Here

            generateProjectionMatrix();
            generateViewMatrix();
        }

        public Matrix4f getView() {
            return new Matrix4f(view);
        }
View Full Code Here

        public Matrix4f getView() {
            return new Matrix4f(view);
        }

        public Matrix4f getProjection() {
            return new Matrix4f(projection);
        }
View Full Code Here

        public Matrix4f getProjection() {
            return new Matrix4f(projection);
        }

        private void generateProjectionMatrix() {
            projection = new Matrix4f();
            float y_scale = (float) (1 / Math.tan(Utils.degreesToRadians(fieldOfView / 2f)));
            float x_scale = y_scale / aspectRatio;
            float frustum_length = far_plane - near_plane;
            projection.m00 = x_scale;
            projection.m11 = y_scale;
View Full Code Here

            //Calculating u
            Vector3f.cross(up, w, u);
            u.normalise();
            //Calculating v
            Vector3f.cross(w, u, v);
            view = new Matrix4f();
            view.m00 = u.x;
            view.m10 = u.y;
            view.m20 = u.z;
            view.m30 = -Vector3f.dot(u, cameraPos);
            view.m01 = v.x;
View Full Code Here

TOP

Related Classes of org.lwjgl.util.vector.Matrix4f

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.