Package fcagnin.jglsdk.glm

Examples of fcagnin.jglsdk.glm.Mat4


  public void scale(float f) {
    scale(f, f, f);
  }
 
  public void scale(float x, float y, float z) {
    Mat4 mat = new Mat4();
   
    mat.clear(0);
    mat.set(0, x);
    mat.set(5, y);
    mat.set(10, z);
    mat.set(15, 1);

    currentMatrix.mul(mat);
  }
View Full Code Here


    scale(vec.x, vec.y, vec.z);
  }

 
  public void translate(float x, float y, float z) {
    Mat4 mat = new Mat4();

    mat.clear(1);
    mat.set(12, x);
    mat.set(13, y);
    mat.set(14, z);

    currentMatrix.mul(mat);
  }
View Full Code Here

      }
    }
   
   
    public Mat4 calcMatrix() {
      Mat4 translateMat = new Mat4(1.0f);
      translateMat.setColumn(3, new Vec4(m_po.position, 1.0f));

      return translateMat.mul(Glm.matCast(m_po.orientation));
    }
View Full Code Here

        glBindVertexArray( vao );

        float elapsedTime = getElapsedTime() / 1000.0f;
        for ( Instance currInst : instanceList ) {
            final Mat4 transformMatrix = currInst.constructMatrix( elapsedTime );

            glUniformMatrix4( modelToCameraMatrixUnif, false, transformMatrix.fillAndFlipBuffer( mat4Buffer ) );
            glDrawElements( GL_TRIANGLES, indexData.length, GL_UNSIGNED_SHORT, 0 );
        }

        glBindVertexArray( 0 );
        glUseProgram( 0 );
View Full Code Here

    private abstract class Instance {
        abstract Vec3 calcOffset(float elapsedTime);

        Mat4 constructMatrix(float elapsedTime) {
            Mat4 theMat = new Mat4( 1.0f );
            theMat.setColumn( 3, new Vec4( calcOffset( elapsedTime ), 1.0f ) );

            return theMat;
        }
View Full Code Here

        glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

        MatrixStack modelMatrix = new MatrixStack();
        modelMatrix.setMatrix( viewPole.calcMatrix() );

        final Mat4 worldToCamMat = modelMatrix.top();
        LightBlockGamma lightData = lights.getLightInformationGamma( worldToCamMat );
        lightData.gamma = gamma;

        glBindBuffer( GL_UNIFORM_BUFFER, lightUniformBuffer );
        glBufferSubData( GL_UNIFORM_BUFFER, 0, lightData.fillAndFlipBuffer( lightBlockBuffer ) );
View Full Code Here

        Mat4 currMat;


        MatrixStack() {
            matrices = new Stack<>();
            currMat = new Mat4( 1.0f );
        }
View Full Code Here

        Mat4 top() {
            return currMat;
        }

        void push() {
            matrices.push( new Mat4( currMat ) );
        }
View Full Code Here

            currMat = matrices.pop();
        }


        void rotateX(float angDeg) {
            currMat.mul( new Mat4( Hierarchy.this.rotateX( angDeg ) ) );
        }
View Full Code Here

        void rotateX(float angDeg) {
            currMat.mul( new Mat4( Hierarchy.this.rotateX( angDeg ) ) );
        }

        void rotateY(float angDeg) {
            currMat.mul( new Mat4( Hierarchy.this.rotateY( angDeg ) ) );
        }
View Full Code Here

TOP

Related Classes of fcagnin.jglsdk.glm.Mat4

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.