- /
-
symphony 🐬 2
on 17 Oct 2024
- 11
- 238
- 0
- 0
- 1248
Cite your audio source here (if applicable):
Music (YouTube) : Symphony (Rainbow Dolphin) [8 Bit Tribute to Clean Bandit feat. Zara Larsson] - 8 Bit Universe
drawframe(1);
Write your drawframe function below
function drawframe(f)
w = warning ('off','all');
%% rainbow shape generation
clf % needed to control alpha channels
lliwiau = 50; % number of rainbow colours rendered
addasu = 0.15; % offsetting factor for colours
enfys = jet(round(lliwiau*(1+addasu))); % generation of rainbow
ehangu = 2; % rainbow arc expansion factor
%% rainbow animation
fframantoli = 20; % frames for rainbow generation
dmantoli = 0.3; % fraction of video where rainbow starts
mantoli = [repelem(0.5,round(dmantoli*(96-fframantoli))),linspace(0.5,0.1,fframantoli),repelem(0.1,round((1-dmantoli)*(96-fframantoli)))];
% calculates the angle the rainbow makes
dpylu = 80; % animates the rainbow fade
if f < dpylu
pylu = 1;
else
pylu = (96-f)/(96-dpylu);
end
ax1 = polaraxes;
for j = 1:lliwiau % produces a polar region per colour, varying alpha with colour and time
polarregion([mantoli(f)*pi,(1-mantoli(f))*pi],[ehangu*lliwiau+j,ehangu*lliwiau+j+1],'FaceColor',enfys(j,:,:),'FaceAlpha',(j/lliwiau)*(pylu))
end
ax2 = axes('Color','none'); % set up cartesian axis
set([ax1, ax2], 'visible', 'off', 'position', [0 0 1 1])
set(gcf, 'color', [.2 .4 .8])
axis equal tight
xlim(ax2, [0,10]);
ylim(ax2, [0,10]);
hold on
xpara = linspace(0,6,96); % defines the path of the dolfish
ypara = 7-((xpara-sqrt(6)-1).^2);
xsinu= linspace(-10,10,96); % defines the water beneath
ysinu = 3 + 0.5*sin(1.2*xpara + f*0.2);
npwyntiau = 50; % number of points in dolfish
gwerthoedd = linspace(0,2*pi,npwyntiau);
% the dolfish comes alive
xdolff = cos(gwerthoedd)-((sin(gwerthoedd)).^2)/sqrt(2) + xpara(f);
ydolff = cos(gwerthoedd).*sin(gwerthoedd) + ypara(f);
plot(polyshape(xdolff,ydolff),'FaceColor',[.6,.6,.7],'EdgeColor',[.6,.6,.7],'LineWidth',3,'FaceAlpha',1);
A = area(xsinu,ysinu);
A.EdgeColor = "none";
A.FaceColor = [.4,.7,.8];
text(5,6.5,'i''ve given up', 'HorizontalAlignment', 'center', 'FontWeight','bold', 'FontSize', 28, 'Color', 'white')
end