• Remix
  • Share
  • New Entry

on 12 Oct 2024
  • 13
  • 84
  • 0
  • 1
  • 1696
Boing Sound by SiliconeSound -- https://freesound.org/s/595465/ -- License: Attribution 4.0
I chopped up the sound to pick the boing noises I liked, and then synchronized different sounds to different bouncing letters.
drawframe(1)
function drawframe(f)
% Shorteners
q=@triangulation;
j=@polyshape;
K='KeepCollinearPoints';
% Transforms
persistent WX WR
if f==1
% Word Shape
g=figure('Color','w','Vis','off','Pos',[ 100 100 3000 300 ]);
a=axes(g,'Vis','off');
t=text(a,15,15,'H A N S','Units','pixel', 'FontSize',30,'FontWeight','bold','FontUnits','Pix','VerticalA','baseline');
F=getframe(a,t.Extent);
close(g)
V=contourc(double(flipud(F.cdata(:,:,1))),[50 50])';
% Convert contour matrix into polyshape verts
i=1;
while i<size(V,1)
n=V(i,2);
V(i,:)=nan;
i=i+1+n;
end
% Center and scale to unit height
V=(V-min(V))/max(V(:,2),[],'all');
% Convert to polyshape so we get a clean triangulation
W1=j(V(2:end,:),K,true);
W1=W1.polybuffer(.011);
% Create the WordSphere
Th=.5; % radius of inner/outer part of sphere.
WX=gobjects(0);
WR=gobjects(0);
W2=sortregions(W1,'centroid','ascend','ReferencePoint',[0 0]);
r=regions(W2);
% Pick nice colors for the letters.
colororder dye
for k=1:numel(r)
T=q(r(k));
V=T.Points;
F=T.ConnectivityList;
E=T.freeBoundary;
WW=diff([min(V);max(V)]);
V=V-min(V)-WW/2.2;
R=1:size(E,1);
L2=size(V,1);
NF=[F; F+L2;
E(R,[2 1 2])+[0 0 L2];
E(R,[1 1 2])+[0 L2 L2];
];
EF=[E;E+L2];
WX(k)=hgtransform;
WR(k)=hgtransform(WX(k));
WT=q(NF,[V(:,1) zeros(L2,1) V(:,2)
V(:,1) ones(L2,1)*Th V(:,2) ]);
patch(WR(k),'Vertices',WT.Points,'Faces',WT.ConnectivityList,...
'SeriesI',k,'FaceC','flat',...
'FaceA',1,...
'EdgeC','n');
patch(WR(k),'Vertices',WT.Points,'Faces',EF,...
'FaceVertexC',[],'FaceC','none','EdgeC','w','LineW',3);
end
set(gcf,'Color','k');
daspect([1 1 1]);
view([0 0])
set(gca,'pos',[0 0 1 1],'clipping','off');
axis([-.5 2.1 -1 1 0 3],'off')
end
f = mod(f-2,48)+1;
% Place each letter bouncing to its own beat.
spc=(1:48)/48;
Yp=abs(cospi(spc*2));
Rp=spc*2*pi;
Sd=[0 diff(Yp)];
Sm=1-Yp;
Sm(Sd<0)=0;
Sv=sinpi(spc*12);
Wk = [0.77 0.55 0.61 0.66];
Ws = [14 7 0 15];
Wh = [1.3 1 0.5 1];
Wrs = [0 0 1
0 1 1
1 0 0
1 1 0];
Wrm = [0.5 1 2 1];
accum=0;
t=@makehgtform;
for k=1:numel(WX)
fk=mod(f+Ws(k),48)+1;
WR(k).Matrix = t('axisrotate',Wrs(k,:),Rp(f)*Wrm(k));
WX(k).Matrix = t('translate',[accum 0 Yp(fk)*Wh(k)*3], 'scale', 1+[-Sv(fk) -Sv(fk) Sv(fk)]*Sm(fk)/2);
accum=accum+Wk(k);
end
end
Movie
Audio
Remix Tree