Package javax.media.opengl

Examples of javax.media.opengl.GL2.glTranslatef()


            @Override
            public void render() {
                System.out.println("Canvas3D.render()");
                GraphicsContext3D gc = GraphicsContext3D.getGC();
    GL2 gl = gc.getGL();
    gl.glTranslatef(-1.5f, 0.0f, -6.0f);
    gl.glBegin(GL2.GL_TRIANGLES);
    gl.glVertex3f( 0.0f1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
    gl.glEnd();
View Full Code Here


    gl.glBegin(GL2.GL_TRIANGLES);
    gl.glVertex3f( 0.0f1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
    gl.glEnd();
    gl.glTranslatef(3.0f, 0.0f, 0.0f);
    gl.glBegin(GL2.GL_QUADS);
    gl.glVertex3f(-1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f1.0f, 0.0f);
    gl.glVertex3f( 1.0f, -1.0f, 0.0f);
    gl.glVertex3f(-1.0f, -1.0f, 0.0f);
View Full Code Here

        // ------ Bind texture ------
        texture.enable(gl);
        texture.bind(gl);

        // ----- Your OpenGL rendering code here ( Render a white triangle for testing ) -----
        gl.glTranslatef(0.0f, 0.0f, -6.0f); // translate into the screen
        gl.glBegin(GL_QUADS); // draw using quads
            gl.glTexCoord2f(textureLeft, textureBottom);
            gl.glVertex3f(0.0f, 0.0f, 0.0f);

            gl.glTexCoord2f(textureRight, textureTop);
View Full Code Here

        // ------ Bind texture ------
        texture.enable(gl);
        texture.bind(gl);

        // ----- Your OpenGL rendering code here ( Render a white triangle for testing ) -----
        gl.glTranslatef(0.0f, 0.0f, -6.0f); // translate into the screen
        gl.glBegin(GL_QUADS); // draw using quads
            gl.glTexCoord2f(textureLeft, textureBottom);
            gl.glVertex3f(0.0f, 0.0f, 0.0f);

            gl.glTexCoord2f(textureRight, textureTop);
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.