Advertisement
Guest User

Untitled

a guest
Jul 7th, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. int i=0;
  2. int i2=0;
  3. float b = 10;
  4. void setup()
  5. {
  6. size(1900, 1000, OPENGL);
  7. strokeCap(SQUARE);
  8. background(255);
  9. pushMatrix();
  10. fill(225, 0, 0);
  11. translate(width/2, height/2, 800);
  12. box(200, 150, 400);
  13. popMatrix();
  14. pushMatrix();
  15. translate((width/2)-20, height/2, 750);
  16. box(100, 100, 10);
  17. popMatrix();
  18. }
  19. void draw() {
  20. background(255);
  21. resetEn();
  22. moveFW();
  23. }
  24. void moveFW()
  25. {
  26. if (keyPressed)
  27. {
  28. if (key=='w')
  29. {
  30.  
  31. i2++;
  32. }
  33. }
  34. }
  35. void resetEn() {
  36. background(255);
  37. pushMatrix();
  38. fill(225, 0, 0);
  39. translate(width/2, height/2, 800+i2);
  40. rotateY(mouseX*0.01);
  41. box(200, 150, 400);
  42. popMatrix();
  43. pushMatrix();
  44. translate((width/2)-20, height/2, 750+i2);
  45. rotateY(mouseX*0.01);
  46. box(100, 100, 10);
  47. popMatrix();
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement