Package fcagnin.jglsdk.glutil

Examples of fcagnin.jglsdk.glutil.MatrixStack.push()


        currMatrix.setMatrix( calcLookAtMatrix( camPos, camTarget, new Vec3( 0.0f, 1.0f, 0.0f ) ) );

        glUseProgram( theProgram );

        {
            currMatrix.push();
            currMatrix.scale( 100.0f, 1.0f, 100.0f );

            glUniform4f( baseColorUnif, 0.2f, 0.5f, 0.2f, 1.0f );
            glUniformMatrix4( modelToCameraMatrixUnif, false, currMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
View Full Code Here


            currMatrix.pop();
        }

        {
            currMatrix.push();
            currMatrix.translate( camTarget );
            currMatrix.applyMatrix( Glm.matCast( orientation ) );
            currMatrix.rotateX( -90.0f );

            // Set the base color for this object.
View Full Code Here

            modelMatrix.pop();
        }

        if ( drawCameraPos ) {
            modelMatrix.push();

            modelMatrix.setIdentity();
            modelMatrix.translate( new Vec3( 0.0f, 0.0f, -viewPole.getView().radius ) );

            glDisable( GL_DEPTH_TEST );
View Full Code Here

            Mesh pMesh = useInfinity ? objectMesh : planeMesh;

            glBindBufferRange( GL_UNIFORM_BUFFER, materialBlockIndex, materialUniformBuffer,
                    currMaterial * materialOffset, MaterialBlock.SIZE );

            modelMatrix.push();

            modelMatrix.applyMatrix( objtPole.calcMatrix() );
            modelMatrix.scale( useInfinity ? 2.0f : 4.0f );

            Mat3 normMatrix = new Mat3( modelMatrix.top() );
View Full Code Here

            modelMatrix.pop();
        }

        if ( drawLights ) {
            modelMatrix.push();

            modelMatrix.translate( new Vec3( calcLightPosition() ) );
            modelMatrix.scale( 0.25f );

            glUseProgram( unlit.theProgram );
View Full Code Here

            glUseProgram( 0 );
        }

        if ( drawCameraPos ) {
            modelMatrix.push();

            modelMatrix.setIdentity();
            modelMatrix.translate( new Vec3( 0.0f, 0.0f, -viewPole.getView().radius ) );
            modelMatrix.scale( 0.25f );
View Full Code Here

        glUniform4f( vertexDiffuseColor.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f );
        glUniform4f( vertexDiffuseColor.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f );
        glUseProgram( 0 );

        {
            modelMatrix.push();

            // Render the ground plane.
            {
                modelMatrix.push();
View Full Code Here

        {
            modelMatrix.push();

            // Render the ground plane.
            {
                modelMatrix.push();

                glUseProgram( whiteDiffuseColor.theProgram );
                glUniformMatrix4( whiteDiffuseColor.modelToCameraMatrixUnif, false,
                        modelMatrix.top().fillAndFlipBuffer( mat4Buffer ) );
                Mat3 normMatrix = new Mat3( modelMatrix.top() );
View Full Code Here

                modelMatrix.pop();
            }

            // Render the Cylinder
            {
                modelMatrix.push();

                modelMatrix.applyMatrix( objtPole.calcMatrix() );

                if ( drawColoredCyl ) {
                    glUseProgram( vertexDiffuseColor.theProgram );
View Full Code Here

                modelMatrix.pop();
            }

            // Render the light
            if ( drawLight ) {
                modelMatrix.push();

                modelMatrix.translate( worldLightPos.x, worldLightPos.y, worldLightPos.z );
                modelMatrix.scale( 0.1f, 0.1f, 0.1f );

                glUseProgram( unlit.theProgram );
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.