• Remix
  • Share
  • New Entry

on 28 Nov 2023
  • 11
  • 9
  • 0
  • 0
  • 583
drawframe(1);
Write your drawframe function below
function drawframe(f)
figure;
axis off;
hold on;
baseX = [0, 0.2, 0.2, -0.2, -0.2];
baseY = [0, 0, 2, 2, 0];
fill(baseX, baseY, [0.5, 0.5, 0.5]); % Gray color
towerX = [-0.05, 0.05, 0.05, -0.05];
towerY = [2, 2, 4, 4];
fill(towerX, towerY, [0.7, 0.7, 0.7]);
rotationAngle = 2*f*pi/48;
bladeLength = 2.5;
numBlades = 7;
bladeWidth = 7;
for i = 1:numBlades
angle = (2 * pi * i / numBlades) + rotationAngle;
bladeX = [0, bladeLength * cos(angle), 0];
bladeY = [4, 4 + bladeLength * sin(angle), 4];
plot(bladeX, bladeY, 'Color', [0.7, 0.7, 0.7], 'LineWidth', bladeWidth); % Green color for blades
end
topX = [0, -0.1, 0.1];
topY = [4, 4.3, 4.3];
fill(topX, topY, [0.8, 0.8, 0.2]);
hold off;
end
Animation
Remix Tree