Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i=0;
- int i2=0;
- float b = 10;
- void setup()
- {
- size(1900, 1000, OPENGL);
- strokeCap(SQUARE);
- background(255);
- pushMatrix();
- fill(225, 0, 0);
- translate(width/2, height/2, 800);
- box(200, 150, 400);
- popMatrix();
- pushMatrix();
- translate((width/2)-20, height/2, 750);
- box(100, 100, 10);
- popMatrix();
- }
- void draw() {
- background(255);
- resetEn();
- moveFW();
- }
- void moveFW()
- {
- if (keyPressed)
- {
- if (key=='w')
- {
- i2++;
- }
- }
- }
- void resetEn() {
- background(255);
- pushMatrix();
- fill(225, 0, 0);
- translate(width/2, height/2, 800+i2);
- rotateY(mouseX*0.01);
- box(200, 150, 400);
- popMatrix();
- pushMatrix();
- translate((width/2)-20, height/2, 750+i2);
- rotateY(mouseX*0.01);
- box(100, 100, 10);
- popMatrix();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement