Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
void setup() {
  size(400, 400);
  background(0);
  colorMode(HSB,360,100,100);
  stroke(0,0,100);
  fill(200,100,100);
}
...
RectDrawer r = new RectDrawer();

void setup() {
  size(400, 400);
  background(0);
  colorMode(HSB,360,100,100);
  stroke...
RectDrawer r1;
RectDrawer r2;

void setup() {
  size(400, 400);
  colorMode(HSB,360,100,100);
  stroke(0,0,100);
  fill(20...
class RectDrawer {
  float x, y, rectSize;

    RectDrawer(float x, float y, float rectSize){
      this.x = x;
      this...
class Car {

 color   c;
 float   xpos;
 float   ypos;
 float   xvel;

 Car(color c, float xpos, float ypos, float xvel) {...
void drive () {
      xpos = xpos + xvel;
      if (xpos > width) {
        xpos = -20;
      }
    }
}
Car myCar1;
Car myCar2;

void setup() {
	   size(400,400);
	   frameRate(30);
	   colorMode(HSB,360,100,100);
	   myCar1 =...
class Car {

	   color   c;
	   float   xpos;
	   float   ypos;
	   float   xvel;

	   Car(color c, float xpos, float ypos...
void drive () {
	   	 xpos = xpos + xvel;
	   	 if (xpos > width) {
	   	 	    xpos = -20;
	   	 }
	   }
}
int MAX = 100;
Car[] myCars = new Car[MAX];

void setup() {
  size(400,400);
  frameRate(30);
  noStroke();
  colorMode(HS...
void draw() {
  background(0);
  for (int i = 0; i < MAX; i++) {
    myCars[i].drive();
    myCars[i].draw();
  }
}
class Car {
	
	   color c;
	   float xpos;
	   float ypos;
	   float xvel;
	
	   Car(color c, float xpos, float ypos, floa...
void drive () {
	   	 xpos = xpos + xvel;
	   	 if (xpos > width) {
	   	 	    xpos = -20;
	   	 }
	   }
}
xn+1 = sin(ayn) - cos(axn)
yn+1 = sin(bxn) - cos(byn)
int num = 3000;
float[] a = new float[4];
float drawScale = 0.2;
float range = 2.5;
boolean drawing = false;
Attr[] attr =...
void draw(){
	   for(int i=0;i<num;i++){
	   	 attr[i].update();
	   }
}

void mouseReleased(){
	   if(!drawing){
	   	 ne...
void newDraw(){
	   background(0);
	   initParam();
	   for(int i=0;i<num;i++){
	   	 attr[i]=new Attr();
	   }
}
void ini...
class Attr {
	   float nx,ny,ox,oy;
	   color myc;
	   Attr(){
	   	 ox =random(-2.0,2.0);
	   	 oy =random(-2.0,2.0);
	  ...
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Proga 0608
Upcoming SlideShare
Loading in …5
×

of

Proga 0608 Slide 1 Proga 0608 Slide 2 Proga 0608 Slide 3 Proga 0608 Slide 4 Proga 0608 Slide 5 Proga 0608 Slide 6 Proga 0608 Slide 7 Proga 0608 Slide 8 Proga 0608 Slide 9 Proga 0608 Slide 10 Proga 0608 Slide 11 Proga 0608 Slide 12 Proga 0608 Slide 13 Proga 0608 Slide 14 Proga 0608 Slide 15 Proga 0608 Slide 16 Proga 0608 Slide 17 Proga 0608 Slide 18 Proga 0608 Slide 19 Proga 0608 Slide 20 Proga 0608 Slide 21 Proga 0608 Slide 22 Proga 0608 Slide 23 Proga 0608 Slide 24 Proga 0608 Slide 25 Proga 0608 Slide 26 Proga 0608 Slide 27 Proga 0608 Slide 28 Proga 0608 Slide 29 Proga 0608 Slide 30 Proga 0608 Slide 31 Proga 0608 Slide 32 Proga 0608 Slide 33 Proga 0608 Slide 34 Proga 0608 Slide 35 Proga 0608 Slide 36 Proga 0608 Slide 37 Proga 0608 Slide 38 Proga 0608 Slide 39 Proga 0608 Slide 40 Proga 0608 Slide 41
Upcoming SlideShare
Proga 0622
Next
Download to read offline and view in fullscreen.

1 Like

Share

Download to read offline

Proga 0608

Download to read offline

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Proga 0608

  1. 1. void setup() { size(400, 400); background(0); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); } void draw() { rectMode(CENTER); rect(width/2,height/2,200,200); }
  2. 2. RectDrawer r = new RectDrawer(); void setup() { size(400, 400); background(0); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); rectMode(CENTER); } void draw() { r.drawRect(); } class RectDrawer { void drawRect() { rect(width/2,height/2,200,200); } }
  3. 3. RectDrawer r1; RectDrawer r2; void setup() { size(400, 400); colorMode(HSB,360,100,100); stroke(0,0,100); fill(200,100,100); rectMode(CENTER); } void draw() { background(0); r1 = new RectDrawer(200,200,200); r2 = new RectDrawer(110,260,150); r1.drawRect(); r2.drawRect(); }
  4. 4. class RectDrawer { float x, y, rectSize; RectDrawer(float x, float y, float rectSize){ this.x = x; this.y = y; this.rectSize = rectSize; } void drawRect() { rect(x,y,rectSize,rectSize); } }
  5. 5. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  6. 6. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  7. 7. Car myCar1; Car myCar2; void setup() { size(400,400); frameRate(30); colorMode(HSB,360,100,100); myCar1 = new Car(color(200,100,100),0,150,1); myCar2 = new Car(color(0,100,100),0,250,2); } void draw() { background(0); myCar1.draw(); myCar2.draw(); myCar1.drive(); myCar2.drive(); }
  8. 8. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  9. 9. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  10. 10. int MAX = 100; Car[] myCars = new Car[MAX]; void setup() { size(400,400); frameRate(30); noStroke(); colorMode(HSB,360,100,100); for (int i = 0; i < MAX; i++) { color tempcolor = color(random(360),random(50,100),random(50,100)); myCars[i] = new Car(tempcolor,random(width),random(height),random(1,5)); } }
  11. 11. void draw() { background(0); for (int i = 0; i < MAX; i++) { myCars[i].drive(); myCars[i].draw(); } }
  12. 12. class Car { color c; float xpos; float ypos; float xvel; Car(color c, float xpos, float ypos, float xvel) { this.c = c; this.xpos = xpos; this.ypos = ypos; this.xvel = xvel; } void draw () { fill(c); rect(xpos,ypos,20,10); }
  13. 13. void drive () { xpos = xpos + xvel; if (xpos > width) { xpos = -20; } } }
  14. 14. xn+1 = sin(ayn) - cos(axn) yn+1 = sin(bxn) - cos(byn)
  15. 15. int num = 3000; float[] a = new float[4]; float drawScale = 0.2; float range = 2.5; boolean drawing = false; Attr[] attr = new Attr[num]; void setup(){ size(640,640); background(0); fill(255,255,255,40); noStroke(); smooth(); framerate(30); newDraw(); drawing = true; }
  16. 16. void draw(){ for(int i=0;i<num;i++){ attr[i].update(); } } void mouseReleased(){ if(!drawing){ newDraw(); drawing = true; loop(); } else { noLoop(); drawing = false; } }
  17. 17. void newDraw(){ background(0); initParam(); for(int i=0;i<num;i++){ attr[i]=new Attr(); } } void initParam(){ a[0] =random(0,3.0); a[1] =random(0,3.0); a[2] =random(0,3.0); a[3] =random(0,3.0); }
  18. 18. class Attr { float nx,ny,ox,oy; color myc; Attr(){ ox =random(-2.0,2.0); oy =random(-2.0,2.0); } void update(){ nx = sin(a[0]*oy)-cos(a[1]*ox); ny = sin(a[2]*ox)-cos(a[3]*oy); ellipse(nx*width*drawScale+width/2, ny*height*drawScale +height/2, 0.3, 0.3); ox=nx; oy=ny; } }
  • m0Rya

    Sep. 30, 2014

Views

Total views

1,320

On Slideshare

0

From embeds

0

Number of embeds

143

Actions

Downloads

8

Shares

0

Comments

0

Likes

1

×