//
float mx;
float my;
float delay = 10.0;

void setup()
{
	 size(400,400);
	 colorMode(HSB,360,100,100,100);
	 smooth();
...
//
float mx;
float my;
float delay = 10.0;

void setup()
{
	   size(400,400);
	   colorMode(HSB,360,100,100,100);
	   smoo...
//
int LENGTH = 30;
int[] x = new int[LENGTH];
int[] y = new int[LENGTH];

void setup(){
	   size(400,400);
	   colorMode(...
//                              	 	    y[LENGTH-i] = y[LENGTH-
int NUM = 12;                       i-1];
int DELAY = 10;  ...
//
void setup(){
	 size(400,400);
	 colorMode(HSB,360,100,100,100);
	 frameRate(30);
	 smooth();
	 noFill();
	 stroke(200,...
//                (          )       	   	   line(-5,0,5,0);
int NUM = 400;                            	   	   ellipse(7,0...
//                             	   pushMatrix();
                                    	   translate(width/2, height/2);
   ...
//
void mousePressed(){
	 pressed = true;
}
//
void mouseReleased(){
	 pressed = false;
}
//
void drawGrid(){
	 fill(0,0,1...
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Proga 090525
Upcoming SlideShare
Loading in …5
×

Proga 090525

1,399 views
1,310 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,399
On SlideShare
0
From Embeds
0
Number of Embeds
301
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide




























  • Proga 090525

    1. 1. // float mx; float my; float delay = 10.0; void setup() { size(400,400); colorMode(HSB,360,100,100,100); smooth(); fill(200,100,100,100); noStroke(); } void draw() { background(0,0,25); ellipse(mouseX, mouseY, 40, 40); }
    2. 2. // float mx; float my; float delay = 10.0; void setup() { size(400,400); colorMode(HSB,360,100,100,100); smooth(); noStroke(); } void draw() { background(0,0,25); float dx = mouseX - mx; if(abs(dx) > 1) { mx = mx + dx/delay; } float dy = mouseY - my; if(abs(dy) > 1) { my = my + dy/delay; } fill(200,80,80); ellipse(mx, my, 40, 40); }
    3. 3. // int LENGTH = 30; int[] x = new int[LENGTH]; int[] y = new int[LENGTH]; void setup(){ size(400,400); colorMode(HSB,360,100,100,100); frameRate(30); smooth(); stroke(200,100,100); noFill(); } void draw(){ background(0); for(int i=1; i<LENGTH; i++){ x[LENGTH-i] = x[LENGTH-i-1]; y[LENGTH-i] = y[LENGTH-i-1]; } x[0] = mouseX; y[0] = mouseY; ellipse(x[LENGTH-1],y[LENGTH-1],40,40); }
    4. 4. // y[LENGTH-i] = y[LENGTH- int NUM = 12; i-1]; int DELAY = 10; } int LENGTH = NUM*DELAY; x[0] = mouseX; int MAX_SIZE = 600; y[0] = mouseY; int[] x = new int[LENGTH]; for(int i=1; i<NUM; i++){ int[] y = new int[LENGTH]; ellipse(x[i*DELAY], y[i*DELAY], void setup(){ dSize*i, size(400,400); dSize*i); colorMode(HSB,360,100,100,100); } frameRate(30); } smooth(); stroke(200,100,100,100); noFill(); } void draw(){ background(0); float dSize = MAX_SIZE / NUM; for(int i=1; i<LENGTH; i++){ x[LENGTH-i] = x[LENGTH- i-1];
    5. 5. // void setup(){ size(400,400); colorMode(HSB,360,100,100,100); frameRate(30); smooth(); noFill(); stroke(200,100,100); } void draw(){ background(0,0,25); float x = width/2; float y = height/2; translate(x,y); rotate(atan2(mouseY-y,mouseX-x)); line(-10,0,10,0); ellipse(14,0,8,8); }
    6. 6. // ( ) line(-5,0,5,0); int NUM = 400; ellipse(7,0,4,4); float[] x = new float[NUM]; popMatrix(); float[] y = new float[NUM]; } } // void setup(){ size(400,400); colorMode(HSB,360,100,100,100); frameRate(30); smooth(); noFill(); stroke(200,100,100); for(int i=0; i<NUM; i++){ x[i] = random(width); y[i] = random(height); } } void draw(){ background(0); for(int i=0; i<NUM; i++){ pushMatrix(); translate(x[i],y[i]); rotate(atan2(mouseY-y[i], mouseX-x[i]));
    7. 7. // pushMatrix(); translate(width/2, height/2); rotate(angle); float aSpeed, angle; drawGrid(); boolean pressed; popMatrix(); // angle += aSpeed; void setup(){ if(pressed){ size(400,400); aSpeed += 0.001; colorMode(HSB,360,100,100,100); } rectMode(CENTER); else if(aSpeed>0) { frameRate(30); aSpeed -= 0.01; smooth(); } else { noFill(); aSpeed = 0; noStroke(); } aSpeed = 0; } angle = 0; pressed = false; } // void draw(){ background(0,0,25);
    8. 8. // void mousePressed(){ pressed = true; } // void mouseReleased(){ pressed = false; } // void drawGrid(){ fill(0,0,100); rect(-200,-200,400,400); rect(200,200,400,400); fill(0,0,0); rect(-200,200,400,400); rect(200,-200,400,400); }

    ×