animate(function(t) { loop(0, pi, 800, function(i) { var a = 100*i + sin(t/24+i), z = sin(i) * cos(a) + 4, x = sin(i) * sin(a), y = cos(i) * (1+0.1*sin(t/12)) + 0.3*cos(t/24); circle(4*x/z, 4*y/z, 0.04 - z/125); }); });