Sapporo Open Lab 2012

  • Programming Lab
なにか気付いた点があれば、↓に自由にコメントしていってください。
name
comment


  • Program Data of Worksheet

using Processing
2012/6/28 ayumikizuka
-------------------------------
example
-------------------------------
■1
int p1 = 90;
int p2 = 80;
int p3 = 60;
int p4 = 50;
int p5 = 20;

size(200, 200);
background(0);

// Draw white points
stroke(255);
point(p4, p5);
point(p1, p5);
point(p4, p4);
point(p3, p3);
point(p2, p3);
point(p1, p4);

// Draw gray box
stroke(153);
line(p4, p4, p3, p3);
line(p3, p3, p2, p3);
line(p2, p3, p1, p4);


■2
colorMode(RGB,100);
size(200, 200);
background(#32CD32);

rect(10,20,180,140);
//rect(0,20,200,140);
rect(50,160,100,20);
rect(10,180,180,20);
fill(0,0,0,50);
triangle(100,40,80,20,120,20);

fill(99,99,0,99);//R,G,B,透明度
stroke(99,0,0,99);
ellipse(50,70,20,20);
fill(0,99,0,99);
ellipse(150,70,20,20);
fill(0,0,99,99);
triangle(100,80,90,100,110,100);
fill(0,88,91,99);
stroke(99,99,0,99);
noStroke();
//rect(70,120,60,15);
quad(80,120,120,120,130,135,70,135);


■3
size(200,200);
rectMode(CENTER);
colorMode(HSB,100);
background(99);
noStroke();
smooth();

fill(45,60,99);
rect(100,100,100,100);
fill(45,40,99);
rect(100,100,60,60);
fill(45,20,99);
rect(100,100,20,20);

noStroke();
fill(20,99,99,60);
ellipse(24,24,30,30);
ellipse(176,24,30,30);
ellipse(24,176,30,30);
ellipse(176,176,30,30);

noFill();
strokeWeight(60);

stroke(80,99,99,30);
ellipse(50,50,200,200);
ellipse(150,50,200,200);
ellipse(50,150,200,200);
ellipse(150,150,200,200);


■4
colorMode(RGB,100);
size(200, 200);
background(99);
noStroke();
smooth();

int a = 20;
int b = 20;

for(int i=0; i<5 ; i++){
a = 20;
for(int j=0; j<5 ; j++){
fill(i*10,j*10,99,60);
ellipse(a,b,40,40);
a = a + 40;
}
b = b + 40;
}


■5
colorMode(RGB,100);
size(200, 200);
background(99);
noStroke();

int a = 20;
int b = 20;

for(int i=0; i<500 ; i++){
float c1 = random(0,100);
float c2 = random(0,100);
float c3 = random(0,100);
fill(c1, c2, c3, 60);

float x = random(200);
float y = random(200);
rect(x, y, 10, 10);
}


■6
colorMode(RGB,100);
size(200, 200);
background(99);
noStroke();
smooth();

int a = 20;
int b = 20;

for(int i=0; i<500 ; i++){
float c1 = random(0,100);
float c2 = random(0,100);
float c3 = random(0,100);
fill(c1, c2, c3, 60);

float x = random(200);
float y = random(200);

float r = random(0,5);
ellipse(x, y, r, r);
}








最終更新:2012年07月13日 10:43