Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Generate snow animation.
- snow :
- nb_frames=400
- # Generate volumetric image of rotating snowflakes.
- shape_snowflake 300
- repeat 100 {
- f:=3+0.5*$> +resize[0] $f%,$f%,1,1,2 rotate. {lerp(0,90,$>/10)},1,0
- }
- remove[0] append z,0.5 autocrop. rescale2d. 16
- # Generate time-parameterized motion curves.
- local[] { 8,1,1,{3*1000} rand. 0,1 s c,-3 rbf $nb_frames,0,1 append c }
- # Render animation frames.
- repeat $nb_frames { f=$>
- echo[] "\r > Frame "{$f+1}/$nb_frames
- 400,400
- {1,s/3},1,1,1,"
- begin(P = I[#1,"$>"]; S = vector(#w#0*h#0*3,255));
- k3 = 3*x;
- x = P[k3]*w#-1;
- y = P[k3 + 1]*h#-1;
- r = round(lerp(0,d#0 - 1,cut(P[k3 + 2],0,1)));
- M = crop(#0,0,0,r,w#0,h#0,1);
- draw(#-1,S,x,y,0,0,w#0,h#0,1,1,0.75,M);
- " remove.
- text_outline. "Snow",0.5~,0.5~,${"font macondo,150"},3,1,255
- }
- remove[0,1]
Advertisement
Add Comment
Please, Sign In to add comment