• Remix
  • Share
  • New Entry

on 29 Nov 2023
  • 8
  • 15
  • 0
  • 0
  • 443
drawframe(1);
Write your drawframe function below
function drawframe(f)
rng(1,'twister')
[X, Y] = meshgrid(linspace(-5, 5, 50), linspace(-5, 5, 50));
Z = sin(sqrt(X.^2 + Y.^2));
surf(X, Y, Z);
colormap(copper)
shading interp
hold on;
num_drops = 2000;
drops_height = 0.2;
L=rand(2, num_drops);
drops_positions =(-1 + 2*L).*0.5;
drops_heights = drops_height .* (-1 + 2 * rand(1, num_drops));
plot3(drops_positions(1,:).*f/15, drops_positions(2,:).*f/15, drops_heights.*f,'.','color',[0.2, 0.6, 1])
axis([ -5 5 -5 5 -3 10])
hold off;
axis off
end
Animation
Remix Tree