Kwp2 100114
Upcoming SlideShare
Loading in...5
×
 

Kwp2 100114

on

  • 1,142 views

 

Statistics

Views

Total Views
1,142
Views on SlideShare
1,122
Embed Views
20

Actions

Likes
0
Downloads
5
Comments
0

3 Embeds 20

http://yoppa.org 14
http://yoppa.jpn.org 5
http://www.slideshare.net 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Kwp2 100114 Kwp2 100114 Presentation Transcript

  • 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); }
  • 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(); }
  • // 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();
  • 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; }
  • // 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);
  • 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; }