• Remix
  • Share
  • New Entry

on 21 Nov 2023
  • 7
  • 9
  • 0
  • 0
  • 395
drawframe(1);
Write your drawframe function below
function drawframe(f)
%% OK SO i was working on a geology animation that involves rotating a shape
%% but when i tried rotating the shape it just started groovin' instead of rotating in the plane i wanted it to
%% in its current form i think this is HILARIOUS so i'm posting as is and will post the actual working version when i finish it
% more geology
% yippee!!
% petrography
% the poor man's set(gcf): because i can't quite figure it out
plot(0,0,'.k', 'MarkerSize', 1100)
hold on
plot(0,0,'.', 'MarkerSize', 700, 'Color', [0.95 0.95 0.95])
set(gca,'Position',[0 0 1 1]) % Enlarge axes
xlim([-0.75 0.75]); ylim([-0.75 0.75]);
hold on
theta = f*360/48;
% make our calcite crystal
xlx = [-0.34, -0.38, 0.08, 0.25, 0.29, 0]; xly = [-0.35 0.25 0.55 0.35 -0.18 -0.41];
rotate = [cosd(theta) -sind(theta); sind(theta) -cosd(theta)];
xl = [xlx; xly]'*rotate;
patch(xl(:,1), xl(:,2), [0.5 0.5 0.5])
end
Animation
Remix Tree