Examples of FloatMatrix4x4


Examples of com.googlecode.gwtgl.example.client.util.math.FloatMatrix4x4

        flatLightDirection[2]);
    webGLWrapper.uniform3f(shaderProgram
        .getUniformLocation("directionalColor"), directionalColorRed,
        directionalColorGreen, directionalColorBlue);

    FloatMatrix4x4 normalMatrix = rotationMatrix.inverse();
    normalMatrix = normalMatrix.transpose();
    webGLWrapper.uniformMatrix4fv(shaderProgram
        .getUniformLocation("normalMatrix"), false, normalMatrix
        .getColumnWiseFlatData());

    checkErrors();
    webGLWrapper.drawArrays(PrimitiveRenderingMode.TRIANGLES, 0, 36);
    checkErrors();
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

        flatLightDirection[2]);   
    GL20.glUniform3f(uAmbientColorUniform, ambientColorRed, ambientColorGreen, ambientColorBlue);   
    GL20.glUniform3f(uDirectionalColorUniform, directionalColorRed, directionalColorGreen, directionalColorBlue)

    //Normal matrix to adjust the directional light depending upon rotation
    FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
    normalMatrix = normalMatrix.transpose();
    float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
    normalMatrixBuffer.position(0);
    normalMatrixBuffer.put(normalMatrixData);
    normalMatrixBuffer.position(0);

    GL20.glUniformMatrix4(normalMatrixUniform, false, normalMatrixBuffer);
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

     float[] resultingMatrixData = updateView();
     resultingMatrixBuffer = ByteBuffer.allocateDirect(resultingMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     resultingMatrixBuffer.put(resultingMatrixData);
     resultingMatrixBuffer.position(0);

     FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
     normalMatrix = normalMatrix.transpose();
     float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
     normalMatrixBuffer = ByteBuffer.allocateDirect(normalMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     normalMatrixBuffer.put(normalMatrixData);
     normalMatrixBuffer.position(0);

     //        initVertexBuffer(tmpIntBuffer);
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

    GL20.glUniform3f(uAmbientColorUniform, ambientColorRed, ambientColorGreen, ambientColorBlue);   
    GL20.glUniform3f(uDirectionalColorUniform, directionalColorRed, directionalColorGreen, directionalColorBlue)

    //Normal matrix to adjust the directional light depending upon rotation
    //TODO need to handle the rotation
    FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
    normalMatrix = normalMatrix.transpose();
    float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
    normalMatrixBuffer.position(0);
    normalMatrixBuffer.put(normalMatrixData);
    normalMatrixBuffer.position(0);

    GL20.glUniformMatrix4(normalMatrixUniform, false, normalMatrixBuffer);
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

     float[] resultingMatrixData = updateView();
     resultingMatrixBuffer = ByteBuffer.allocateDirect(resultingMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     resultingMatrixBuffer.put(resultingMatrixData);
     resultingMatrixBuffer.position(0);

     FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
     normalMatrix = normalMatrix.transpose();
     float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
     normalMatrixBuffer = ByteBuffer.allocateDirect(normalMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     normalMatrixBuffer.put(normalMatrixData);
     normalMatrixBuffer.position(0);

     checkErrors("After Initializing BUffers");
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

         * @param column major matrix
         * @return FloatMatrix4x4
         */
        public static FloatMatrix4x4 convertToFloatMatrix4x4(float[] srtMatrix)
        {
        return new FloatMatrix4x4(new float[][]{
            {srtMatrix[0], srtMatrix[4], srtMatrix[8], srtMatrix[12]},
            {srtMatrix[1], srtMatrix[5], srtMatrix[9], srtMatrix[13]},
            {srtMatrix[2], srtMatrix[6], srtMatrix[10], srtMatrix[14]},
            {srtMatrix[3], srtMatrix[7], srtMatrix[11], srtMatrix[15]}       
            })
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

    GL20.glUniform3f(uAmbientColorUniform, ambientColorRed, ambientColorGreen, ambientColorBlue);   
    GL20.glUniform3f(uDirectionalColorUniform, directionalColorRed, directionalColorGreen, directionalColorBlue)

    //Normal matrix to adjust the directional light depending upon rotation
    //TODO need to handle the rotation
    FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
    normalMatrix = normalMatrix.transpose();
    float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
    normalMatrixBuffer.position(0);
    normalMatrixBuffer.put(normalMatrixData);
    normalMatrixBuffer.position(0);

    GL20.glUniformMatrix4(normalMatrixUniform, false, normalMatrixBuffer);
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

     float[] resultingMatrixData = updateView();
     resultingMatrixBuffer = ByteBuffer.allocateDirect(resultingMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     resultingMatrixBuffer.put(resultingMatrixData);
     resultingMatrixBuffer.position(0);

     FloatMatrix4x4 normalMatrix = ((FloatMatrix4x4)rotationMatrix).inverse();
     normalMatrix = normalMatrix.transpose();
     float[] normalMatrixData = normalMatrix.getColumnWiseFlatData();
     normalMatrixBuffer = ByteBuffer.allocateDirect(normalMatrixData.length*4).order(ByteOrder.nativeOrder()).asFloatBuffer();
     normalMatrixBuffer.put(normalMatrixData);
     normalMatrixBuffer.position(0);

     checkErrors("After Initializing BUffers");
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

           * @return lookat matrix.
           */
         
          public FloatMatrix4x4 createLookAtMatrix()
          {
            FloatMatrix4x4 matrix = MatrixUtil.createLookAtMatrix(RenderPosition.X, RenderPosition.Y, RenderPosition.Z,
                    RenderFocalPoint.X, RenderFocalPoint.Y, RenderFocalPoint.Z,
                    0f, 0f, 1f);
           
            return matrix;
          }
View Full Code Here

Examples of com.ngt.jopenmetaverse.shared.sim.rendering.math.FloatMatrix4x4

  public void Render(RenderPass pass, int pickingID, RenderingContext scene, float time) throws Exception
  {
    if (!RenderSettings.AvatarRenderingEnabled && Attached) return;

    // Prim roation and position and scale
    FloatMatrix4x4 srt4x4Matrix= Math3D.convertToFloatMatrix4x4(Math3D.CreateSRTMatrix(Prim.Scale, RenderRotation, RenderPosition));

    //    FloatMatrix totalMatrix = scene.getPerspectiveMatrix().multiply(scene.getTranslationMatrix()).multiply(scene.getRotationMatrix().multiply(srt2Matrix));
    FloatMatrix totalMatrix = scene.getResultingMatrix().multiply(srt4x4Matrix);
    floatBuffer.position(0);
    floatBuffer.put(totalMatrix.getColumnWiseFlatData()).position(0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.