JoshuaDavis icon

Untitled

JoshuaDavis | PRO | 10/23/17 03:05:47 PM UTC | 0 ⭐ | 302 👁️ | Never ⏰ | []
Java |

490 B

|

None

|

0 👍

/

0 👎

PImage myTexture;
 
void setup() {
    size(500,500,P3D);
    myTexture = loadImage("tex1.png");
}
 
void draw() {
    background(#CCCCCC);
    textureMode(NORMAL);
 
    pushMatrix();
        translate(width/2,height/2);
        scale(300);
 
        strokeWeight(0);
        noStroke();
        noFill();
        tint(#FF3300);
 
        beginShape(QUADS);
            texture(myTexture);
            vertex(-0.5, -0.5,   0,0);
            vertex( 0.5, -0.5,   1,0);
            vertex( 0.5,  0.5,   1,1);
            vertex(-0.5,  0.5,   0,1);
        endShape();
    popMatrix();
}

Comments