Advertisement
JoshuaDavis

Untitled

Oct 23rd, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. PImage myTexture;
  2.  
  3. void setup() {
  4.     size(500,500,P3D);
  5.     myTexture = loadImage("tex1.png");
  6. }
  7.  
  8. void draw() {
  9.     background(#CCCCCC);
  10.     textureMode(NORMAL);
  11.  
  12.     pushMatrix();
  13.         translate(width/2,height/2);
  14.         scale(300);
  15.  
  16.         strokeWeight(0);
  17.         noStroke();
  18.         noFill();
  19.         tint(#FF3300);
  20.  
  21.         beginShape(QUADS);
  22.             texture(myTexture);
  23.             vertex(-0.5, -0.5,   0,0);
  24.             vertex( 0.5, -0.5,   1,0);
  25.             vertex( 0.5,  0.5,   1,1);
  26.             vertex(-0.5,  0.5,   0,1);
  27.         endShape();
  28.     popMatrix();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement