Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. PImage txtr;
  2. PVector off;
  3. PVector scl;
  4.  
  5. void setup() {
  6. size(512, 256, P3D);
  7. textureMode(NORMAL);
  8. textureWrap(REPEAT);
  9. noStroke();
  10.  
  11. txtr = loadImage("txtr.png");
  12. off = new PVector();
  13. float aspect = width / (float)height;
  14. scl = new PVector(3 * aspect, 3);
  15. }
  16.  
  17. void draw() {
  18. background(0xffffffff);
  19.  
  20. beginShape();
  21. texture(txtr);
  22. vertex(0, 0, 0, off.x, off.y);
  23. vertex(width, 0, 0, off.x + scl.x, off.y);
  24. vertex(width, height, 0, off.x + scl.x, off.y + scl.y);
  25. vertex(0, height, 0, off.x, off.y + scl.y);
  26. endShape(CLOSE);
  27.  
  28. off.x += 0.01;
  29. off.y += 0.005;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement