- /
-
Heavens Embraced: A Journey to the Other Side
on 9 Oct 2024
- 15
- 575
- 0
- 9
- 1421
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Absolute-Credits for the code go to the marvelous Mr. Tim Marston.
% I dedicate this entry to my recently departed mother, with all my love.
% Love you, Mom and Dad. You’re together now, again.
rng default
x = linspace(-1, 1, 240);
b=length(x);
d=x(1:2:end)/2;
c=length(d);
r = ifftshift(sqrt((x*2).^2 + d'.^2 + permute(x.^2, [1, 3, 2])));
ags = linspace(0, 2*pi, 97);
enz = exp(6i*randn(c, b, b))./max(r.^2.4,2e-5);
[mx, my] = meshgrid(x);
rd = (mx-0.000006).^2 + (my+0.000002).^2;
mn = 1 - erf(max(rd - 0.00000001, 0));
cmp = linspace(0, 1, 256)'.*[1, 1, 1];
cmp(:, 1) = cmp(:, 1).^1.6;
cmp(:, 2) = cmp(:, 2).^1.6*0.97;
cmp(:, 3) = tanh(cmp(:, 3))*1.1;
dt = abs(ifftn(exp(1i*(x.*ags(f)/2 - ags(f)/2)).*enz));
dt = 5*dt.*(d-d(1))'.*permute(erf((x - 0.1)*2)+1, [1, 3, 2]);
dt = dt(:, :, 1:end);
ap = dt > 0.08;
c_alp = cumsum(ap, 3);
CLS = (1.1 - erf(c_alp/5)).*ap.*dt;
ALP = ap.*rescale(dt);
[AI, AS] = P(ALP,CLS);
AI = circshift(squeeze(AI)', [0, -5*f]);
AS = circshift(squeeze(AS)', [0, -5*f]);
C = round(min(AI*40, 1)*255 + 1);
C = double(ind2rgb(C, cmp));
PP = @(x)permute(x, [3, 2, 1]);
A = PP(cat(3, AS, mn, ones(size(mn))));
IG = PP([P(A, PP(cat(3, C(:, :, 1), mn, 0*mn)));
P(A, PP(cat(3, C(:, :, 2), mn, 0*mn)));
P(A, PP(cat(3, C(:, :, 3), mn*0.9, 0*mn)))]);
IG = flipud(IG);
IG(:, :, 1) = max(0, IG(:, :, 1) - 0.2);
IG(:, :, 2) = max(0, IG(:, :, 2) - 0.1);
IG(:, :, 3) = min(1, IG(:, :, 3) + 0.5);
figure('Color', [1 1 1]);
image(IG);
axis equal;
camva(5.8);
axis off
function [AIf, ASf] = P(ATf, CLSf)
ASf = ATf(1, :, :);
AIf = CLSf(1, :, :);
for nf = 2:size(ATf, 1)
APf = ASf;
ASf = APf + ATf(nf, :, :).*(1 - APf);
AIf = (AIf.*APf + CLSf(nf, :, :).*ATf(nf, :, :).*(1 - APf))./(eps + ASf);
end
end
end