• Remix
  • Share
  • New Entry

  • Teodo

  • /
  • Ascension: Now We Are Free

on 31 Oct 2024
  • 24
  • 160
  • 0
  • 0
  • 1969
Cite your audio source here (if applicable): Now We Are Free (Gladiator (2000)) - The Lyndhurst Orchestra, Lisa Gerrard, Gavin Greenaway, Hans Zimmer (Super Theme Song)
drawframe(1);
Write your drawframe function below
function drawframe(f)
% A quick remix-mashup, before heading off to my seaside house
% to celebrate All Saints' Day and Day of the Dead.
% Wishing a pleasant and reflective holiday to everyone who observes!
persistent S Q
l = @linspace;
v = @(x)x./vecnorm(x);
C = @circshift;
cc = @(x)C(x,[-f,-f]*4);
r = @(x)x/2+fftshift(x)/2;
F = @ifft2;
R = @reshape;
B = @erf;
Y = @sqrt;
P = @randn;
J = @meshgrid;
[x,y,z] = sphere(100);
s = v([1;1;1]);
g = .5-B((Y(sum(((cat(3,x,y,z)-permute(s,[3,2,1])).^2),3))-.5)*5)/2;
g = g+B(l(-1.5,1,101)'*3)/2+.5;
[A,E] = J(l(-pi,pi,101),l(-pi/2,pi/2,101));
ags = l(0,2*pi,97);
p = sin(ags(1:end-1))/80;
cy = [p-.8;-p-.8;-cos(2*ags(1:end-1))/30+.05];
cu = C([-p;p;ones(1,96)],[0,5])*1.3;
ct = C(cy.*[1;1;1.4],[0,-5])+[.2;.2;0];
c = cy(:,f);
N = 768;
q = l(-1,1,N+1);
q = q(1:N);
[q1,q2] = J(q);
n = hann(N)*hann(N)';
d = @(a,b,c,h)ifftshift(n.^10.*exp(6i*P(N)+h*1i)./((q+a).^2+(q+b)'.^2+c));
wt = cc(r(real(F(d(.01,.01,5e-5,ags(f)*3)*.3+d(.02,.06,1e-3,9*ags(f))/3))/5+.4));
[sx,sy,sz] = surfnorm(q1,q2,wt);
M = [sx(:),sy(:),sz(:)];
X = [q1(:),q2(:),wt(:)];
ry = v(X'-c)';
I = dot(M,ry,2); I(I<0)=0;
t = Y(1-1.1.^2*(1-I.^2)).*M+1.1*(ry-I.*M);
G = imag(t(:,3))~=0;
t = real(t);
[Z,L,~] = cart2sph(t(:,1),t(:,2),t(:,3));
L = R(interp2(A,E,g,Z,L,'cubic',0),[N,N]);
L(G) = 0;
I = M(:,3);
t = real(v((Y(1-0.95.^2*(1-I.^2)).*M+0.95*([0,0,1]-I.*M))')');
dxy = t(:,1:2).*(-.2-X(:,3))./t(:,3);
qp = [q1(:),q2(:)];
[~,D] = knnsearch(qp+dxy,qp,'K',10);
V = sum(exp(-1e5*(D.^2)),2)*1.3;
[sx,sy,sz] = surfnorm(q1,q2,q1+q2);
vc = sx*s(1)+sy*s(2)+sz*s(3);
cwv = v(X'-c)';
[sx,sy,sz] = surfnorm(q1,q2,wt);
wc = R(sx(:).*cwv(:,1)+sy(:).*cwv(:,2)+sz(:).*cwv(:,3),[N,N]);
o = ones(N,N);
c1 = cat(3,1,.9,.8).*o;
c2 = flip(c1,3)/3;
cA = o.*cat(3,0,.6,1)/2;
cl = (c1+c2).*vc*1.5.*B(R(V,[N,N])/10)*2;
mp = flipud(winter(256));
L(L<.5) = 1.5*wc(L<.5);
L(L<.5) = .5;
L(L>1.5) = 1.5;
W = ind2rgb(round(255*rescale(L)),mp);
w = B(R(Y(sum((c-[q1(:),q2(:),X(:,3)]').^2)),[N,N])*2-2)/2+.5;
cl = w.*cA+(1-w).*cl;
W = w.*cA+(1-w).*W;
qn = -((q+1)'.^2+(q+1).^2).^2/50;
if f==1
S = surf(q,q',q1+q2,cl);
hold on;
Q = surf(q,q',wt+qn,W);
shading flat;
axis equal off;
set(gcf,'color',[0,.6,1]/2);
camproj('perspective');
camva(65);
else
S.CData = cl;
Q.CData = W;
S.ZData = q1+q2;
Q.ZData = wt+qn;
end
campos(c);
camtarget(ct(:,f));
camup(cu(:,f));
end
Movie
Audio
Remix Tree