728x90
๋ฐ์ํ
๋ถ๊ฝ๋์ด ๐
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
void setup(){
size(600,600);
}
void draw(){
background(0);
int n=0;
strokeWeight(3);
while(n<10){
stroke(random(255),random(255),random(255));
line(mouseX,mouseY,random(width),random(height));
n++;
}
}
|
cs |
์ถฉ๋ํ๋ฉด ์ฌ๋ผ์ ธ~ ๐ฆ๐ฆ๐ฆ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
int []bricks=new int[10];
boolean []alive=new boolean[10];
void setup(){
size(600,600);
for(int i=0;i<bricks.length;i++){
bricks[i]=i*100+50;
alive[i]=true;
}
fill(#FF0000);
noStroke();
}
void draw(){
background(0);
for(int i=0;i<bricks.length;i++){
if(alive[i]){
ellipse(bricks[i],width/2,100,100);
}
}
fill(#FFFF00);
ellipse(mouseX,mouseY,30,30);
fill(#FF0000);
for(int i=0;i<bricks.length;i++){
if(dist(mouseX,mouseY,bricks[i],width/2)<50+15){
alive[i]=false;
}
}
}
|
cs |
ํ๊ฒจ๋๊ฐ๊ธฐ๐ฅ
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | float x,y; float easing=0.1; void setup(){ size(600,600); } void draw(){ background(128); float dx=mouseX-x; x+=dx*easing; float dy=mouseY-y; y+=dy*easing; ellipse(x,y,100,100); } | cs |
728x90
๋ฐ์ํ
'processing' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ํ๋ก์ธ์ฑ ์ํ๋๋น] Lecture08_transform (0) | 2022.06.04 |
---|---|
[Processing] Chapter 7_function/ Chapter8_Object (0) | 2022.03.13 |
[Processing] Chapter5_์กฐ๊ฑด๋ฌธ (0) | 2022.03.12 |
[Processing] Chapter4_variables (0) | 2022.03.12 |
[Processing] bounce ball (0) | 2022.03.10 |
๋๊ธ