Examples of glTexCoord2f()


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

        c = t.getColor(1);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc2.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc2.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(2);
        c = t.getColor(2);
        if(c == null) c = color;
View Full Code Here

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

        c = t.getColor(2);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc3.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc3.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
   
        }
    } else {
        for(int i = 0; i < triangles.length; i++) {
View Full Code Here

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

        if (tc3 == null) throw new IllegalArgumentException("Texture coordinate for triangle must not be null");

        p = t.getPoint(0);
        float texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc1.x;
        float texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc1.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(1);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc2.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc2.y;
View Full Code Here

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

            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(1);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc2.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc2.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(2);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc3.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc3.y;
View Full Code Here

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

            gl.glVertex2f(p.x, p.y);
       
            p = t.getPoint(2);
        texX = coords.left() + (coords.right() - coords.left()) / joglImage.texture.getImageWidth() * tc3.x;
        texY = coords.top() + (coords.bottom() - coords.top()) / joglImage.texture.getImageHeight() * tc3.y;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
   
        }
    }
  }
View Full Code Here

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

        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);
            gl.glVertex3f(1.0f, 0.0f, 0.0f);
View Full Code Here

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

        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);
            gl.glVertex3f(1.0f, 0.0f, 0.0f);

            gl.glTexCoord2f(textureRight, textureTop);
            gl.glVertex3f(1.0f, 1.0f, 0.0f);
View Full Code Here

Examples of net.java.games.jogl.GL.glTexCoord2f()

        if(data != null) {
            gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, formatWidth, formatHeight,  inputColorOrder, inputFormat, data);
        }
               
        gl.glBegin(GL.GL_QUADS);
          gl.glTexCoord2f(0,0);
          gl.glVertex3d(-1, 1,0);
          gl.glTexCoord2f(extendX,0);
          gl.glVertex3d(1, 1,0);
          gl.glTexCoord2f(extendX,extendY);
          gl.glVertex3d(1, -1,0);
View Full Code Here

Examples of net.java.games.jogl.GL.glTexCoord2f()

        }
               
        gl.glBegin(GL.GL_QUADS);
          gl.glTexCoord2f(0,0);
          gl.glVertex3d(-1, 1,0);
          gl.glTexCoord2f(extendX,0);
          gl.glVertex3d(1, 1,0);
          gl.glTexCoord2f(extendX,extendY);
          gl.glVertex3d(1, -1,0);
          gl.glTexCoord2f(0,extendY);
          gl.glVertex3d(-1, -1,0);
View Full Code Here

Examples of net.java.games.jogl.GL.glTexCoord2f()

        gl.glBegin(GL.GL_QUADS);
          gl.glTexCoord2f(0,0);
          gl.glVertex3d(-1, 1,0);
          gl.glTexCoord2f(extendX,0);
          gl.glVertex3d(1, 1,0);
          gl.glTexCoord2f(extendX,extendY);
          gl.glVertex3d(1, -1,0);
          gl.glTexCoord2f(0,extendY);
          gl.glVertex3d(-1, -1,0);
        gl.glEnd();
       
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.