• Remix
  • Share
  • New Entry

on 14 Oct 2024
  • 20
  • 333
  • 0
  • 1
  • 991
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
persistent T1 T2 T3 T4 P1 P2 P4 s1 s2 s4
if(f == 1)
T1 = hgtransform('Matrix', makehgtform('translate', [8,3,0]));
T2 = hgtransform('Matrix', makehgtform('translate', [0,0,0]));
T3 = hgtransform('Matrix', makehgtform('translate', [8,0,0]));
T4 = hgtransform('Matrix', makehgtform('translate', [8,1,0]));
axis([0,13,0,5]); ax = gca; ax.XTick = 0:13; ax.YTick = 0:5;
fill([0,5,5], [0,0,2], 'r', 'FaceAlpha', 0.4, Parent = T1);
fill([0,8,8], [0,0,3], 'g', 'FaceAlpha', 0.4, Parent = T2);
fill([0,5,5,2,2,0], [0,0,2,2,1,1], 'b', 'FaceAlpha', 0.4, Parent = T3);
fill([0,2,2,5,5,0], [0,0,1,1,2,2], 'y', 'FaceAlpha', 0.4, Parent = T4);
grid on; daspect([1,1,1]);
P1 = [8,3,0; 0,3,0; 0,0,0]; s1 = [0,20,30];
P2 = [0,0,0; 0,2,0; 5,2,0]; s2 = [31,40,60];
P4 = [8,1,0; 5,1,0; 5,0,0]; s4 = [61,72,85];
end
f = f - 7;
if(f>0)
if(f < 31)
Animate(T1, P1, s1, f);
elseif(f < 61)
Animate(T2, P2, s2, f);
elseif(f < 86)
Animate(T4, P4, s4, f);
end
end
end
function Animate(Tn, Pn, sn, f)
Tn.Matrix = makehgtform('translate', interp1(sn, Pn, f));
drawnow;
end
Movie
Audio

This submission does not have audio.

Remix Tree