forked from tomekw/whatever
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bear.js
45 lines (37 loc) · 1.05 KB
/
bear.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
a = c.getContext('2d')
t = setInterval(function () {
o = [];
for (y = 7; y --;) {
for (z = 4; z --;) {
for (x = 7; x --;) {
if ('00000100000000000000000000100000011000010100001010000011011111110000011000001011111111111001000100100010011111001111100100010010001001111100100010000000000000000100010010001000000000000000010001'[y*28+z*7+x]==1) {
n = t / 99;
o.push([
x * (v=Math.cos)(n) + z * v(n-8),
y + v((t + x)/9),
z * v(-n) + x * v(-n-8)
]);
}
}
}
}
o.sort(function (a, b) {
return a[2] - b[2];
});
c.width = c.height = 700;
a.translate(350, 90);
a.scale(40, 40);
while (p = o[++y]) {
a.fillStyle = 'hsl(9,80%,' + (5 * p[2] + 40) + '%';
a.beginPath();
a.arc(
p[0],
p[1],
1,
0,
6
);
a.fill();
}
t ++;
},9);