-
Notifications
You must be signed in to change notification settings - Fork 0
/
Punto.pde
62 lines (47 loc) · 991 Bytes
/
Punto.pde
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
41
42
43
44
45
46
47
48
49
50
51
52
53
class Punto{
float xpos, ypos, ox, oy;
int gx, gy; // numero en la grilla
float g = 1;
float rot = random(0, TWO_PI);
boolean libre = true;
boolean cruce = false;
boolean pop = false;
float inc = random(0.001, 0.12);
float largo = map(inc, 0.001, 0.12, 20, 3);
Punto(){
ox = xpos = random(width);
oy = ypos = random(height);
}
Punto(float x, float y){
ox = xpos = x;
oy = ypos = y;
}
void dibuja(){
switch(tp){
case 0:
fill(punto);
noStroke();
ellipse(xpos, ypos, 1.5, 1.5);
break;
case 1:
stroke(punto);
strokeWeight(0.5);
noFill();
ellipse(xpos, ypos, cw*inc*100, cw*inc*100);
break;
case 2:
pushMatrix();
translate(xpos, ypos);
rotate(rot);
stroke(punto);
rot += inc;
strokeWeight(0.5);
line(-largo, 0, largo, 0);
line(0, -largo, 0, largo);
popMatrix();
break;
case 3:
break;
}
}
}