Package com.jogamp.opengl.util.texture

Examples of com.jogamp.opengl.util.texture.TextureCoords.bottom()


  private void renderTexture(Texture texture, double centerX, double centerY) {
    TextureCoords tc = texture.getImageTexCoords();
    float tx1 = tc.left();
    float ty1 = tc.top();
    float tx2 = tc.right();
    float ty2 = tc.bottom();
    float halfWidth = quarterValue(texture.getWidth());
    float halfHeight = quarterValue(texture.getHeight());

    GL2 gl = scene.gl;
    texture.bind(gl);
View Full Code Here


   
    startPrimitive(Primitive.IMAGE, joglImage);
       
    TextureCoords coords = joglImage.texture.getImageTexCoords();
    float texTop = coords.top();
    float texBottom = coords.bottom();
    float texLeft = coords.left();
    float texRight = coords.right();

   
    if(flip == Flip.BOTH || flip == Flip.HORIZONTAL) {
View Full Code Here

    Image joglImage = (Image)image;

    startPrimitive(Primitive.IMAGE, joglImage);

    TextureCoords coords = joglImage.texture.getImageTexCoords();
    float texTop = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * subImageY;
    float texBottom = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * (subImageY + subImageHeight);
    float texLeft = coords.left() + (coords.right() - coords.left()) / image.getWidth() * subImageX;
    float texRight = coords.left() + (coords.right() - coords.left()) / image.getWidth() * (subImageX + subImageWidth);

    if(flip == Flip.BOTH || flip == Flip.HORIZONTAL) {
View Full Code Here

    startPrimitive(Primitive.IMAGE, joglImage);

    TextureCoords coords = joglImage.texture.getImageTexCoords();
    float texTop = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * subImageY;
    float texBottom = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * (subImageY + subImageHeight);
    float texLeft = coords.left() + (coords.right() - coords.left()) / image.getWidth() * subImageX;
    float texRight = coords.left() + (coords.right() - coords.left()) / image.getWidth() * (subImageX + subImageWidth);

    if(flip == Flip.BOTH || flip == Flip.HORIZONTAL) {
      float temp = texTop;
View Full Code Here

        p = t.getPoint(0);
        c = t.getColor(0);
        if(c == null) c = color;
        gl.glColor4f(c.x, c.y, c.z, c.w);
        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);
        c = t.getColor(1);
View Full Code Here

            p = t.getPoint(1);
        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);
View Full Code Here

            p = t.getPoint(2);
        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 {
View Full Code Here

        Vector2f tc3 = t.getTextureCoordinate(2);
        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;
 
View Full Code Here

        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;
        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;
 
View Full Code Here

        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;
        gl.glTexCoord2f(texX, texY);
            gl.glVertex2f(p.x, p.y);
   
        }
    }
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.