- /
-
Winter
on 13 Oct 2024
- 19
- 356
- 1
- 4
- 1788
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(s)
n=200;
if s ==1;
xp=rand(1,n)*5; yp=rand(1,n)*7; o=rand(1,n)* 0.04 + 0.06;
end
global xp yp o
m=96;
x1=linspace(0,2.96,round(m*0.6)); x2=linspace(5,3.24,round(m*0.6));
y1=linspace(-2,-0.4,round(m*0.6)); y2=linspace(6,-0.12,round(m*0.6));
figure; axis off;
sx=[-0.075 0.075 0 -0.053 0.053 0 0 0 0 -0.053 0.053]; sy=[0 0 0 -0.053 0.053 0 -0.075 0.075 0 0.053 -0.053];
HH=sin(2*pi*1*(1:m)/m)*0.6;
for f=s:s
hold on; rectangle('Position',[-1,-2,10,10],'FaceColor','b');
rectangle('Position',[-1,-5,8,5],'Curvature',[1,1],'FaceColor',[0.94 0.94 0.94]);
q(); d(); fi(HH(f),HH(f)*0.019);
theta=linspace(0,2*pi,100);
for l=0:20
r=0.09+l*0.01; xc=r*cos(theta)+3.15+l*0.02; yc=r*sin(theta)+0.75+l*0.3;
fill(xc,yc,[0.8,0.8,0.8],'LineWidth',0.001,'EdgeColor',[0.8,0.8,0.8]);
end
if f<round(m*0.6)
for i=1:n
yp(i)=yp(i)-o(i); if yp(i)<-1, yp(i)=6; end
plot(xp(i)+sx,yp(i)+sy,'w','LineWidth',1.5);
end
axis([x1(f) x2(f) y1(f) y2(f)]);
else
axis([2.96 3.24 -0.4 -0.12]);
end
end
hold off;
function q()
fill([2.4 3.4 3.4 2.4],[-0.6 -0.6 0.2 0.2],[0.6 0.3 0]);
fill([2.2 2.9 3.6],[0.2 0.6 0.2],[0.95 0.95 0.95]);
fill([2.52 2.8 2.8 2.52],[-0.6 -0.6 -0.2 -0.2],[0.4 0.2 0]);
fill([2.96 3.24 3.24 2.96],[-0.4 -0.4 -0.12 -0.12],[1 1 0]);
fill([3.08 3.2 3.2 3.08],[0.28 0.28 0.6 0.6],[0 0 0]);
end
function d()
s=0.2; r=s/2.5;
fill([-0.6 0.6 0.6 -0.6]*(s/2)+3.1,[s/1.3 s/1.3 0.28 0.28]-0.4,[0.8 0.62 0.25]);
fill([-1 1 1 -1]*(s/2)+3.1,[0 0 s/1.3 s/1.3]-0.4,[0.8 0.52 0.25]);
t=linspace(0,pi,100); fill(r*cos(t)+3.1,r*sin(t)-s-0.2,[1 1 1],'FaceColor',[0.1 0.1 0.1]);
end
function fi(H,p)
t=linspace(0,2*pi,100);
a=1; b=2; fill(a*(1-sin(t)).*cos(t+H+0.3)*0.02+3.1-p,(b*(sin(t)-1))*0.02-0.32,[1 0 0]);
a=0.7; b=1.4; fill(a*(1-sin(t)).*cos(t+H)*0.02+3.1-p,(b*(sin(t)-0.4)-2)*0.02-0.32,[1 0.4 0]);
a=0.5; b=1; fill(a*(1-sin(t)).*cos(t+H-0.3)*0.02+3.1-p,(b*(sin(t)-0.9)-2)*0.02-0.32,[1 1 0]);
end
end