tt = 0
Z animate, ->
bg "#ccc";
# animated paper
fill "white"; noStroke();
rx = 0.3; ry = 0.3; tt += 0.1
push()
translate 0.5, 0.5; scale 1, 0.5; rotate QUART_PI
shadow color: '#000', alpha: 0.1, blur: 50, x: 0.001, y: 0.001
para 0, 0,
range: TWO_PI
f: (t) ->
s = 0.2 * cos(t * 6)
# http://math.stackexchange.com/questions/69099/equation-of-a-rectangle
sx = rx * (abs(cos t) * cos(t) + abs(sin t) * sin(t))
sy = ry * (abs(cos t) * cos(t) - abs(sin t) * sin(t))
cx = rx * cos(t * 3 + tt)
cy = ry * sin(t * 3 + tt)
x: cx * (0.2 * s) + sx
y: cy * (0.2 * s) + sy
pop()
# embuke
noFill(); stroke "#000"; strokeWidth 2
a = 0.1; a2 = a * 2
x = 0.15; y = 0.13
para x, y,
range: TWO_PI * 2
f: (t)->
x: a * cos(t) ** 3
y: a * sin(t) ** 3
l = (f) ->
para x, y,
range: [ -a, a2 ], step: a2, f: f, close: no
l (t) -> x: 0, y: t
l (t) -> x: t, y: 0
# lu
r = 0.15;
para 0.15, 0.45,
range: TWO_PI
f: (t)->
x: r * cos(t * 3) * (0.1)
y: r * sin t
close: yes
# at
strokeWidth 1
x = 0.15; y = 0.75
group ->
translate x, y;
rotate tt / 16
range 0, TWO_PI, TWO_PI / 50, (i)->
push()
rotate i;
para 0, 0, f: (t)-> x: t * 0.1, y: 0.01 * sin t * PI
pop()
circle 0, 0, 0.099
#pa
spiked = (r) ->
polar
step: 0.05
radius: ()->
0.2 + r * rand()
push()
strokeWidth 4
translate 0.64, 0.625
scale 0.31
circle(0.5, 0.5, 0.48);
spiked(0.25);
spiked(0.1);
fill('#000', 0.8);
circle(0.5, 0.5, 0.17);
fill('#ffffff', 0.08);
fill('#ffffff', 0.2);
circle(0.62, 0.36, .2);
circle(0.8, 0.5, .05);
pop();
View Compiled