このウィキの読者になる
更新情報がメールで届きます。
このウィキの読者になる
カテゴリー
最近更新したページ
2011-12-05
2010-02-05
2008-01-31
2007-12-09
2007-11-22
2007-11-04
2007-10-06
2007-05-17
2007-05-13
2007-05-11
2007-05-10
最新コメント
1-14 by awesome things!
117 by stunning seo guys
Processing4 Data by stunning seo guys
送信ボタンの仕組み by stunning seo guys
511 by stunning seo guys
510 by music production software
ProStr by awesome things!
FrontPage by check it out
CSV形式とは by check it out
Menu

Processing9 Input1

/*--Input--*/

int gx = 15;
int gy = 35;
float leftColor = 0.0;
float rightColor = 0.0;

void setup()
{
size(200, 200); colorMode(RGB, 1.0); noStroke();
}

void draw()
{
background(0.0); update(mouseX); fill(0.0, leftColor + 0.4, leftColor + 0.6); rect(width/4-gx, width/2-gx, gx*2, gx*2); fill(0.0, rightColor + 0.2, rightColor + 0.4); rect(width/1.33-gy, width/2-gy, gy*2, gy*2);
}

void update(int x)
{
leftColor = -0.002 * x/2 + 0.06; rightColor = 0.002 * x/2 + 0.06; gx = x/2; gy = 100-x/2;

if (gx < 10) { gx = 10; } else if (gx > 90) { gx = 90; }

if (gy > 90) { gy = 90; } else if (gy < 10) { gy = 10; }
}

void setup()
{
size(200, 200); noStroke(); colorMode(RGB, 255, 255, 255, 100); rectMode(CENTER);
}

void draw()
{
background(51); fill(255, 80); rect(mouseX, height/2, mouseY/2+10, mouseY/2+10); fill(255, 80); rect(width-mouseX, height/2, ((height-mouseY)/2)+10, ((height-mouseY)/2)+10);
}

int size = 30;

void setup() {
size(200, 200); ellipseMode(CENTER); fill(126); noStroke(); rect(0, 0, width, height);
}

void draw() {
if(mousePressed) { stroke(255); } else { stroke(51); } line(mouseX-30, mouseY, mouseX+30, mouseY); line(mouseX, mouseY-30, mouseX, mouseY+30);
}

int[] xvals;
int[] yvals;
int[] bvals;

void setup()
{
size(200, 200); xvals = new int[width]; yvals = new int[width]; bvals = new int[width];
}

int arrayindex = 0;

void draw()
{
background(102); for(int i=1; i<width; i++) { xvals[i-1] = xvals[i]; yvals[i-1] = yvals[i]; bvals[i-1] = bvals[i]; } // Add the new values to the end of the array xvals[width-1] = mouseX; yvals[width-1] = mouseY; if(mousePressed) { bvals[width-1] = 0; } else { bvals[width-1] = 255; } fill(255); noStroke(); rect(0, height/3, width, height/3+1);

for(int i=1; i<width; i++) { stroke(255); point(i, xvals[i]/3); stroke(0); point(i, height/3+yvals[i]/3); stroke(255); line(i, 2*height/3+bvals[i]/3, i, (2*height/3+bvals[i-1]/3)); }
}

float mx;
float my;
float delay = 60.0;

void setup()
{
size(200, 200); noStroke();
}

void draw()
{
background( 51 ); float dx = mouseX - mx; if(abs(dx) > 1) { mx = mx + dx/delay; } float dy = mouseY - my; if(abs(dy) > 1) { my = my + dy/delay; } translate( mx, my ); plus();
}

void plus()
{
int s = 20; int t = 3; // Draw the symbol beginShape(); vertex( -t, s ); vertex( t, s ); vertex( t, t ); vertex( s, t ); vertex( s, -t ); vertex( t, -t ); vertex( t, -s ); vertex( -t, -s ); vertex( -t, -t ); vertex( -s, -t ); vertex( -s, t ); vertex( -t, t ); endShape(CLOSE);
}
float mx;
float my;
float delay = 40.0;
float esize = 25.0;
int box = 30;

void setup()
{
size(200, 200); noStroke(); smooth(); ellipseMode(CENTER_RADIUS);
}

void draw()
{
background(51); if(abs(mouseX - mx) > 0.1) { mx = mx + (mouseX - mx)/delay; } if(abs(mouseY - my) > 0.1) { my = my + (mouseY- my)/delay; } float distance = esize * 2; mx = constrain(mx, box+distance, width-box-distance); my = constrain(my, box+distance, height-box-distance); fill(76); rect(box+esize, box+esize, box*3, box*3); fill(255); ellipse(mx, my, esize, esize);
}
int num = 60;
float mx[] = new float[num];
float my[] = new float[num];

void setup()
{
size(200, 200); smooth(); noStroke(); fill(255, 153);
}

void draw()
{
background(51); // Reads throught the entire array // and shifts the values to the left for(int i=1; i<num; i++) { mx[i-1] = mx[i]; my[i-1] = my[i]; } // Add the new values to the end of the array mx[num-1] = mouseX; my[num-1] = mouseY; for(int i=0; i<num; i++) { ellipse(mx[i], my[i], i/2, i/2); }
}
float bx;
float by;
int bs = 20;
boolean bover = false;
boolean locked = false;
float bdifx = 0.0;
float bdify = 0.0;


void setup()
{
size(200, 200); bx = width/2.0; by = height/2.0; rectMode(CENTER_RADIUS);
}

void draw()
{
background(0); // Test if the cursor is over the box if (mouseX > bx-bs && mouseX < bx+bs && mouseY > by-bs && mouseY < by+bs) { bover = true; if(!locked) { stroke(255); fill(153); } } else { stroke(153); fill(153); bover = false; } // Draw the box rect(bx, by, bs, bs);
}

void mousePressed() {
if(bover) { locked = true; fill(255, 255, 255); } else { locked = false; } bdifx = mouseX-bx; bdify = mouseY-by;

}

void mouseDragged() {
if(locked) { bx = mouseX-bdifx; by = mouseY-bdify; }
}

void mouseReleased() {
locked = false;
}
2006年11月18日(土) 10:42:21 Modified by ID:hElD8hu5PA




スマートフォン版で見る