• Remix
  • Share
  • New Entry

  • Teodo

  • /
  • Cherry Blossom at arriving storm

on 18 Nov 2023
  • 13
  • 20
  • 0
  • 0
  • 839
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Again, animation timed-out for greater values of k than 8...
% But, try, values of k around 12 and up, it is really mesmerizing...
cvijettresnje(8,30,1)
function cvijettresnje(k,ug,transp)
f=f/50;
ukiter=k+1;
figure('Position',[10,10,700,700]);
zz=[0 0 0];
duz=3*1.2^ukiter;
w1=k^0.6;
plot([0 0],[-duz,0],'LineWidth',w1,'Color',zz)
xlim([-1.4*duz,1.4*duz]);
ylim([-1.4*duz,1.4*duz]);
axis off
hold on
crtgrane(90,[0,0],ukiter-1,ug,ukiter,transp);
function crtgrane(pocug,tck,iter,ug,ukiter,transp)
duz1=1.2^(iter);
ab=tck(1);
cb=tck(2);
uga=pocug+ug;
ugb=pocug-ug;
cd=duz1*sind(uga)+cb+f*rand;
ef=duz1*sind(ugb)+cb+f*rand;
gh=duz1*cosd(uga)+ab+f*rand;
ij=duz1*cosd(ugb)+ab+f*rand;
ww=[1-iter/(ukiter) 0 1-iter/(ukiter)];
w=iter^0.6;
hold on
s1=plot([ab,gh],[cb,cd],'LineWidth',w,'Color',ww);
s2=plot([ab,ij],[cb,ef],'LineWidth',w,'Color',ww);
if transp==1
uu=1-(ukiter-iter)/ukiter;
s1.Color(4)=uu;
s2.Color(4)=uu;
end
if iter-1>0
crtgrane(uga,[gh,cd],iter-1,ug,ukiter,transp);
crtgrane(ugb,[ij,ef],iter-1,ug,ukiter,transp);
end
end
end
end
Animation
Remix Tree