• Remix
  • Share
  • New Entry

  • Malik

  • /
  • Fragility 🎭

on 13 Oct 2024
  • 38
  • 472
  • 0
  • 7
  • 1970
Cite your audio source here (if applicable):
% Music - The Glory Opening Soundtrack
drawframe(1);
Write your drawframe function below
function drawframe(f)
% This animation depicts a mask being crafted from stained glass and then shattering,
% symbolizing the fragility of human nature.
% Polygons as Stained Glasses
n=29 ; % No of Polygons
% Polygons data
x1=[0 1.3 0];
y1=[10 10 8.5];
x2=[1.3 3.1 2.9 0];
y2=[10 9.9 7.6 8.5];
x3=[0 2.9 2.5];
y3=[8.5 7.6 6.1];
x4=[3.1 5.2 5.2 5.3 2.5 2.9];
y4=[9.9 9.1 6.8 4.3 6.1 7.6];
x5=[5.2 6.6 6 5.3 5.2];
y5=[9.1 7.1 5.1 4.3 6.8];
x6=[0 2.5 0.6 0];
y6=[8.5 6.1 3.1 3.1];
x7=[1.1 2.5 5.3 2.8];
y7=[4 6.1 4.3 4.6];
x8=[0.6 1.1 2.8 5.3 4.5 2.5 1.1];
y8=[3.1 4 4.6 4.3 3.8 3.6 3];
xa=[0 0.6 0.6 0];
ya=[3.1 3.1 -1.2 -1.2];
xb=[0.6 1.1 1.9 1 0.6];
yb=[3.1 3 -1 -1.8 -1.2];
xc=[1.1 2.6 1.9];
yc=[3 2.8 -1];
xd=[2.6 4.8 5.5 3.1 1.9];
yd=[2.8 2.9 0.8 1.1 -1];
xe=[1.9 3.1 5.5];
ye=[-1 1.1 0.8];
xf=[0 0.6 1 0];
yf=[-1.2 -1.2 -1.8 -1.8];
xg=[0 1.7 1 0];
yg=[-4.6 -4.6 -5.9 -5.9];
xh=[0 1 1.2 0];
yh=[-5.9 -5.9 -7 -7];
xi=[1.9 5.5 3.1 3 2.2];
yi=[-1 0.8 -2.9 -3.6 -2.8];
xj=[4.5 5.3 6 6.2 6 5.1];
yj=[3.8 4.3 5.1 4.5 3.4 3.3];
xk=[6 6.2 6 6.6 6.6];
yk=[3.4 4.5 5.1 7.1 3.5];
xl=[4.8 5.9 6 5.1];
yl=[2.9 3.9 3.4 3.3];
xm=[5.5 4.8 5.9];
ym=[0.8 2.9 3.9];
xn=[3 3.1 5.5 3.7];
yn=[-3.6 -2.9 0.8 -3.6];
xo=[1 1.7 3 3.7 3.1];
yo=[-5.9 -4.6 -3.6 -3.6 -5];
xp=[1.2 1 3.1 3.7 5.5 5.9 6 6.6 6.8 6.1 4.8];
yp=[-7 -5.9 -5 -3.6 0.8 3.9 3.4 4.5 3 -1 -4.3];
xq=[0 1 1.9 1.1 0];
yq=[-1.8 -1.8 -1 -2.2 -2.2];
xr=[0 1.1 1.9 2.2 0.7 0.1 0];
yr=[-2.2 -2.2 -1 -2.8 -2.8 -2.85 -2.8];
xs=[0 0.7 2.2 3 2 0.7 0];
ys=[-2.8 -2.8 -2.8 -3.6 -3.1 -3.4 -3.4];
xt= [0 0.1 2 3 1.7 1.1 0];
yt=[-3.4 -3.45 -3.1 -3.6 -4.6 -3.9 -4];
xu=[0 1.1 1.7 0];
yu=[-4 -3.9 -4.6 -4.6];
% Creating Cell Array
a = {x1 x2 x3 x4 x5 x6 x7 x8 xa xb xc xd xe xf xg xh xi xj xk xl xm xn xo xp xq xr xs xt xu};
b = {y1 y2 y3 y4 y5 y6 y7 y8 ya yb yc yd ye yf yg yh yi yj yk yl ym yn yo yp yq yr ys yt yu};
% Setting up figure
figure('color','k')
hold on
% Center points where the polygons join
p = zeros(1, n);
q = zeros(1, n);
for i = 1:n
p(i) = mean(a{i});
q(i) = mean(b{i});
end
k = 48; % Half no of frames
if f>=1 & f<=k
clf
hold on
% Moving Polygons gradually towards center
for i = 1:n
X = a{i} + (p(i) - a{i}) * (1 - f/k);
Y = b{i} + (q(i) - b{i}) * (1 - f/k);
% Reflecting the polygons across the y-axis
fill(X, Y, rand(1,3),-X, Y, rand(1,3))
axis off
axis([-10 10 -10 10])
end
else
%Global Center
c = mean(p);
d = mean(q);
clf
hold on
% Moving polygons gradually away from the global center
for i = 1:n
% Direction vector
u = p(i) - c;
v = q(i) - d;
% r= movement factor, Adjusting the separation distance
r = 2 * (mod(f,k) / k);
X = a{i} + r * u;
Y = b{i} + r * v;
% Reflecting the polygons across the y-axis
fill(X, Y, rand(1,3),-X, Y, rand(1,3))
axis off
axis([-10 10 -10 10])
end
end
end
Movie
Audio
Remix Tree