• Remix
  • Share
  • New Entry

  • Jova

  • /
  • lightning before the thunder

on 18 Oct 2024
  • 10
  • 91
  • 0
  • 0
  • 404
Cite your audio source here (if applicable):
drawframe(1);
Write your drawframe function below
function drawframe(f)
set(gca, 'Color', 'k');
num_bolts = randi([2, 5]);
for bolt = 1:num_bolts
num_points = randi([5, 10]);
x_start = rand * 2 - 1;
y_start = rand * 2 + 1;
x = [x_start, x_start + cumsum(rand(1, num_points) - 0.5)];
y = [y_start, y_start - cumsum(rand(1, num_points))];
plot(x, y, 'y', 'LineWidth', 2);
hold on;
end
axis equal;
axis([-2 2 -2 2]);
title(['Lightning Effect - Frame: ', num2str(f)], 'Color', 'w', 'FontSize', 14);
drawnow;
end
Movie
Audio
Remix Tree