• Remix
  • Share
  • New Entry

on 19 Nov 2023
  • 7
  • 4
  • 1
  • 0
  • 539
drawframe(1);
Write your drawframe function below
function drawframe(f)
[x, y] = meshgrid(-5:0.1:5, -5:0.1:5);
mountain = peaks(x, y);
ocean = zeros(size(mountain));
ocean_color = rand(size(ocean, 1), size(ocean, 2), 3);
surf(x, y, mountain, 'FaceColor', 'interp', 'EdgeColor', 'none');
hold on;
colormap(copper)
surf(x, y, ocean, ocean_color, 'EdgeColor', 'none');
rng(1,"twister");
numBirds = 10;
birdAltitude = 5; % Set the altitude of the birds
birdX = rand(1, numBirds) * 10 - 5 ;
birdY = rand(1, numBirds) * 10 - 5 ;
birdZ = ones(1, numBirds) * birdAltitude;
scatter3(birdX+f/50, birdY+f/50, birdZ+f/75, 5, 'kv', 'filled');
axis([-5 5 -5 5 0 10])
view(30, 30);
axis off
end
Animation
Remix Tree