• Remix
  • Share
  • New Entry

on 17 Oct 2024
  • 39
  • 101
  • 0
  • 2
  • 1606
Cite your audio source here (if applicable):
%Music: Squid Game OST - Pink Soldiers
drawframe(1);
Write your drawframe function below
function drawframe(f)
figure('color','w')
axis off ;
axis([-6.2 6.2 -6.5 6.5 0 8])
hold on ;
LW = 'LineWidth' ;
EC = 'EdgeColor' ;
% Circle
th = linspace(0, 2*pi, 100);
xC = 1.3 * cos(th);
yC = 1.3 * sin(th) + 1.7;
plot(xC, yC,'r', LW, 2);
% Triangle
xT = [0 2 -2 0];
yT = [0 -2 -2 0];
% Square
xS = [1.9 -1.9 -1.9 1.9 1.9];
yS = [-2.7 -2.7 -4.4 -4.4 -2.7];
plot(xT, yT, 'r',xS, yS, 'r',LW, 2);
% Box Measurements
xR = [-1.5, 1.5, 1.5, -1.5];
yR = [-4, -4, 2, 2];
zR = [0, 0, 0, 0];
% Height
h = 3;
cmap = [0.4 0.6 0.1];
colormap(cmap);
fill3(xR, yR, zR,[1 2 2 1],xR, yR, zR + h, [1 2 2 1]); %Top-Base of Box
% Sides of the box
for i = 1:4
j = mod(i, 4) + 1;
fill3([xR(i),xR(j),xR(j),xR(i)],[yR(i),yR(j),yR(j),yR(i)],[zR(i),zR(j),zR(j)+h,zR(i)+h],[1 2 2 1]);
end
% Ribbons
l = 3.1; %Slightly Higher Height for Ribbons
x0 = [-1.6 -1.6 1.6 1.6]; %Top Horizontal
x1 = [-0.2 0.2 0.2 -0.2]; %Top Vertical
y1 = [-4.1 -4.1 2.1 2.1];
z1 = [l l l l];
x2 = [1.6 1.6 1.6 1.6]; %Right Side
y2 = [0.5 1.1 1.1 0.5];
z2 = [0 0 l l];
x3 = -x2; %Left Side
x4 = [-0.2 0.2 0.2 -0.2]; %Front-Back
y3 = [2 2 2 2]+0.1;
y4 = [-4 -4 -4 -4]-0.1;
fill3(x0,y2,z1,'r',x1,y1,z1,'r',x2,y2,z2,'r',x3,y2,z2,'r',x4,y3,z2,'r',x4,y4,z2,'r',EC,'r');
% Bow
t = linspace(0,1,100);
zb = l*ones(size(t));
xb = 1.2*cos(2*pi*t) ;
yb = 0.65*sin(4*pi*t) + 1;
xb1 = 1.4*cos(2*pi*t) ;
yb1 = 0.5*sin(4*pi*t) + 0.8;
fill3(xb, yb, zb, 'r',xb1,yb1,zb,'r',EC,'r');
% Triangles as Ribbons
xt1 = [0 0.4 0.8];
yt1 = [1 -1 -0.7];
zt1 = [l l l];
fill3(xt1, yt1, zt1, 'r',-xt1, yt1, zt1, 'r',EC,'r');
% Bow Knot
xc = 0.3 * cos(th);
yc = 0.3 * sin(th) + 0.9;
zc = l * ones(size(xc));
fill3(xc, yc, zc, 'r',EC,'r');
% Lighting ,Shading & Material
light('Position', [1, 1, 5], 'Style', 'infinite');
lighting phong;
material([0.5 0.4 0.2]);
% Playground Rings
% r1 = 4.5:0.1:5.5; % Increasing radii
% lw1 = 5;
% lw2 = 4;
% k = 10; %no of rings
% for i = 1:k
% x = r1(i) * cos(th) ; % Center of the rings (0,-1)
% y = r1(i) * sin(th) - 1;
% if mod(i,2)==0
% plot(x, y, 'Color', 'w', LW, lw2);
% else
% plot(x, y, 'Color', 'w', LW, lw1);
% end
% end
% Designing Korean Won Symbol to signify Money
n = 50;
z = linspace(9*pi/4,5*pi,n)';
x = 5*sin(2*z);
y = 5*cos(2*z);
plot3(x,y,z,'w')
for i = 1:n
text(x(i),y(i),z(i), '\heartsuit', 'FontSize', 15, 'FontWeight', 'bold','HorizontalAlignment', 'center','Color','red');
end
view([360/95*(f-1),39]) %Gives full rotation and synchronizes animation to music beats
end
Movie
Audio
Remix Tree