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