Package com.googlecode.gwtgl.binding

Examples of com.googlecode.gwtgl.binding.WebGLUniformLocation


    // Load the vertex data
    glContext.bindBuffer(WebGLRenderingContext.ARRAY_BUFFER, buffer);
    glContext.vertexAttribPointer(vertexPositionAttribute, 3, WebGLRenderingContext.FLOAT, false, 0, 0);

    glContext.vertexAttribPointer(textureCoordAttribute, 2, WebGLRenderingContext.FLOAT, false, 0, texCoordsOffset);
    WebGLUniformLocation mvUniform = glContext.getUniformLocation(shaderProgram, "projectionMatrix");

    perspectiveMatrix = MatrixUtil.createPerspectiveMatrix(45, 1.0f, 0.1f, 100);
    translationMatrix = MatrixUtil.createTranslationMatrix(0, 0, translateZ);
    rotationMatrix = MatrixUtil.createRotationMatrix(camera.getRotationXAxis(), camera.getRotationYAxis(), 0);
    resultingMatrix = perspectiveMatrix.multiply(translationMatrix).multiply(rotationMatrix);
View Full Code Here


        .getOffset(VERTICES));

    webGLWrapper.enableVertexAttribArray(1);
    webGLWrapper.vertexAttribPointer(1, 2, DataType.FLOAT, false, 0, buffer
        .getOffset(TEX_COORDS));
    WebGLUniformLocation mvUniform = shaderProgram.getUniformLocation("projectionMatrix");

    perspectiveMatrix = MatrixUtil.createPerspectiveMatrix(45, 1.0f, 0.1f,
        100);
    translationMatrix = MatrixUtil
        .createTranslationMatrix(0, 0, translateZ);
View Full Code Here

    webGLWrapper.vertexAttribPointer(vertexColorAttribute, 4,
        DataType.FLOAT, false, 0, buffer.getOffset(COLORS));
    webGLWrapper.enableVertexAttribArray(vertexColorAttribute);

    // Bind the projection matrix to the shader
    WebGLUniformLocation pUniform = shaderProgram.getUniformLocation("projectionMatrix");
    webGLWrapper.uniformMatrix4fv(pUniform, false, projectionMatrix
        .getColumnWiseFlatData());

    indexBuffer.bind();
   
View Full Code Here

    webGLWrapper.vertexAttribPointer(0, 3, DataType.FLOAT, false, 0, buffer.getOffset(VERTICES));

    webGLWrapper.enableVertexAttribArray(1);
    webGLWrapper.vertexAttribPointer(1, 2, DataType.FLOAT, false, 0, buffer
        .getOffset(TEX_COORDS));
    WebGLUniformLocation mvUniform = shaderProgram.getUniformLocation("projectionMatrix");

    perspectiveMatrix = MatrixUtil.createPerspectiveMatrix(45, 1.0f, 0.1f,
        100);
    translationMatrix = MatrixUtil
        .createTranslationMatrix(0, 0, translateZ);
View Full Code Here

    webGLWrapper.enableVertexAttribArray(2);
    webGLWrapper.vertexAttribPointer(2, 3, DataType.FLOAT, false, 0, buffer
        .getOffset(NORMALS));

    // set up projection matrix
    WebGLUniformLocation mvUniform = shaderProgram.getUniformLocation("projectionMatrix");
    perspectiveMatrix = MatrixUtil.createPerspectiveMatrix(45, 1.0f, 0.1f,
        100);
    translationMatrix = MatrixUtil
        .createTranslationMatrix(0, 0, translateZ);
    rotationMatrix = MatrixUtil
View Full Code Here

        .getOffset(VERTICES));

    webGLWrapper.enableVertexAttribArray(1);
    webGLWrapper.vertexAttribPointer(1, 2, DataType.FLOAT, false, 0, buffer
        .getOffset(TEX_COORDS));
    WebGLUniformLocation mvUniform = shaderProgram.getUniformLocation("projectionMatrix");

    perspectiveMatrix = MatrixUtil.createPerspectiveMatrix(45, 1.0f, 0.1f, 100);
    translationMatrix = MatrixUtil.createTranslationMatrix(0, 0, translateZ);
    rotationMatrix = MatrixUtil.createRotationMatrix(camera.getRotationXAxis(), camera.getRotationYAxis(), 0);
    resultingMatrix = perspectiveMatrix.multiply(translationMatrix).multiply(rotationMatrix);
View Full Code Here

    webGLWrapper.vertexAttribPointer(vertexPositionAttribute, 3,
        DataType.FLOAT, false, 0, 0);
    webGLWrapper.enableVertexAttribArray(vertexPositionAttribute);

    // Bind the projection matrix to the shader
    WebGLUniformLocation pUniform = shaderProgram.getUniformLocation("projectionMatrix");
    webGLWrapper.uniformMatrix4fv(pUniform, false, projectionMatrix
        .getColumnWiseFlatData());

    // Draw the polygons (3 triangles)
    webGLWrapper.drawArrays(PrimitiveRenderingMode.TRIANGLES, 0, 3);
View Full Code Here

TOP

Related Classes of com.googlecode.gwtgl.binding.WebGLUniformLocation

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.