-
Notifications
You must be signed in to change notification settings - Fork 0
/
sketch.js
102 lines (79 loc) · 2.76 KB
/
sketch.js
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/* Fluidez Abstracta
Sol Estefania Gayarin
2023 */
var vari=0;
var devari=1;
let millisecond;
let parcial1=0;
let parcial2=0;
let parcial3=0;
function setup() {
createCanvas(512, 512);
background(0);
}
function draw() {
background(0, 0, 0, 10);
frameRate(20);
stroke(255);
strokeWeight(0.5); //.........................TODO.........................
noFill();
millisecond= millis();
// Actualizar las coordenadas del punto de control-----------------------------------
vari+=devari;
// Invertir la dirección si se alcanzan los límites----------------------------------
if (vari>100 || vari<-10) {
devari*=-1;
}
//FIGURAS INSPIRADAS EN Ben F. Laposky ..........................................
push();//Figura ppal de arriba----------------------------------
beginShape();
bezier(256, 12, 300+vari, 100+vari, 200, 256, 100, 300);
endShape();
pop();
push();
if(millisecond-parcial1>4000){
beginShape();
bezier(256, 12, 300+vari, 100+vari, 200, 256, 200, 400);
endShape();
}
pop();
push();
if(millisecond-parcial2>6000){
beginShape();
bezier(256, 12, 300+vari, 100+vari, 200, 256, 350, 350);
endShape();
}
pop();
push();//Figura ppal de abajo--------------------------------------------------------------
beginShape();
bezier(200, 200, 200-vari, 300+vari, 300, 456, 300, 500);
endShape();
pop();
push();
if(millisecond-parcial1>2000){
beginShape();
bezier(100, 300, 200-vari, 300+vari, 300, 456, 300, 500);
endShape();
}
pop();
push();
if(millisecond-parcial2>4000){
beginShape();
bezier(50, 400, 200-vari, 300+vari, 300, 456, 300, 500);
endShape();
}
pop();
push();
if(millisecond-parcial3>6000){
beginShape();
bezier(75, 500, 200-vari, 300+vari, 300, 456, 300, 500);
endShape();
}
pop();
//Reiniciar la aparición------------------------------------------------------------
if(millisecond-parcial2>15000){
parcial1=millisecond;
parcial2=millisecond;
parcial3=millisecond;
}
}