- /
-
Dance of flower
on 13 Oct 2024
- 11
- 57
- 1
- 0
- 835
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function contestEntry()
totalFrames = 96;
for frameNum = 1:totalFrames
drawframe(frameNum);
end
end
function drawframe(frameNum)
% Parameters for dynamic waveforms and patterns
numWaves = 18; % Number of oscillations
radius = 1; % Maximum radius of the wave
amplitude = 0.4; % Amplitude of the oscillation
theta = linspace(0, 2*pi, 500); % Angular coordinates for plotting
t = frameNum*0.2; % Time factor for the oscillation
% Compute outer wave radial distance
r_outer = radius + amplitude * sin(numWaves * theta - t);
x_outer = r_outer .* cos(theta);
y_outer = r_outer .* sin(theta);
% Compute inner wave radial distance
r_inner = radius/2 + amplitude * sin(numWaves * theta + t);
x_inner = r_inner .* cos(theta);
y_inner = r_inner .* sin(theta);
clf;
% Plot outer and inner waves
plot(x_outer, y_outer, 'LineWidth', 1.5, 'Color', [0.9, 0.0, 0.0]);
hold on;
plot(x_inner, y_inner, 'LineWidth', 1.5, 'Color', [0.9, 0.1, 0.9]);
% Dynamic plot adjustments
axis([-1.5 1.5 -1.5 1.5]);
set(gca,'Color','k');
% Additional visual effects (rotating stars)
numStars = 21;
for k = 1:numStars
angleShift = t + k*pi/numStars;
starRadius = 0.3 + 0.3*cos(angleShift);
rectangle('Position', [-starRadius, -starRadius, 2*starRadius, 2*starRadius], 'Curvature', [1, 1], 'EdgeColor', [0.9 0.2 0.4], 'LineWidth', 0.5);
end
drawnow;
end
Movie
Audio
This submission does not have audio.