Advertisement
JoshuaDavis

Untitled

Mar 25th, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import wblut.math.*;
  2. import wblut.processing.*;
  3. import wblut.core.*;
  4. import wblut.hemesh.*;
  5. import wblut.geom.*;
  6.  
  7. HE_Mesh mesh;
  8. WB_Render render;
  9.  
  10. PImage[] images = new PImage[6];
  11. int whichImage = 0;
  12. PShape s;
  13.  
  14. void setup() {
  15. size(1920, 1440, P3D);
  16.  
  17. images[0] = loadImage("1_1.png");
  18. images[1] = loadImage("1_2.png");
  19. images[2] = loadImage("1_3.png");
  20. images[3] = loadImage("1_4.png");
  21. images[4] = loadImage("1_5.png");
  22. images[5] = loadImage("1_6.png");
  23.  
  24. textureMode(NORMAL);
  25. create();
  26. render = new WB_Render(this);
  27.  
  28. s = render.toSmoothPShape(mesh, images[whichImage]);
  29. }
  30.  
  31. void create() {
  32. HEC_Grid meshGrid=new HEC_Grid();
  33. meshGrid.setU(20);
  34. meshGrid.setV(20);
  35. meshGrid.setUSize(1440);
  36. meshGrid.setVSize(1440);
  37. mesh=new HE_Mesh(meshGrid);
  38. }
  39.  
  40. void draw() {
  41. background(#202020);
  42. shape(s);
  43. }
  44.  
  45. void keyPressed() {
  46. if (key == 'c') { whichImage = ++whichImage%images.length; }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement