0
Upcoming SlideShare
×

# Kwp2 100114

802

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

Views
Total Views
802
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
8
0
Likes
0
Embeds 0
No embeds

No notes for slide
• ### Transcript of "Kwp2 100114"

1. 1. void setup(){ size(400,400); } void draw(){ background(0,0,0); fill(31,127,255); stroke(255,255,255); translate(width/2, height/2); rotate(30); rect(-100,-100,200,200); }
2. 2. void setup(){ size(400,400); } void draw(){ background(0,0,0); fill(31,127,255); stroke(255,255,255); pushMatrix(); translate(100, 100); rotate(30); rect(-50,-50,100,100); popMatrix(); pushMatrix(); translate(300, 300); rotate(10); rect(-50,-50,100,100); popMatrix(); }
3. 3. // float aSpeed, angle; boolean pressed; // void setup(){ size(400,400); frameRate(30); noStroke(); aSpeed = 0; angle = 0; pressed = false; } // void draw(){ background(0); pushMatrix(); translate(width/2, height/2); rotate(angle); fill(31,127,255); rect(-100,-100,200,200); popMatrix();
4. 4. angle += aSpeed; if(pressed){ aSpeed += 0.01; } else if(aSpeed>0) { aSpeed -= 0.02; } else { aSpeed = 0; } } // void mousePressed(){ pressed = true; } // void mouseReleased(){ pressed = false; }
5. 5. // float aSpeed, angle; boolean pressed; // void setup(){ size(400,400); frameRate(30); noStroke(); aSpeed = 0; angle = 0; pressed = false; } // void draw(){ background(0); pushMatrix(); translate(width/2, height/2); rotate(angle); fill(255,255,255); rect(-400,-400,400,400); rect(0,0,400,400); fill(0,0,0); rect(-400,200,400,400);
6. 6. angle += aSpeed; if(pressed){ aSpeed += 0.01; } else if(aSpeed>0) { aSpeed -= 0.02; } else { aSpeed = 0; } } // void mousePressed(){ pressed = true; } // void mouseReleased(){ pressed = false; }
1. #### A particular slide catching your eye?

Clipping is a handy way to collect important slides you want to go back to later.