• Remix
  • Share
  • New Entry

on 27 Nov 2023
  • 25
  • 95
  • 2
  • 3
  • 369
drawframe(1);
Write your drawframe function below
function drawframe(f)
% Taubin's Heart Beating in MATLAB
% By Victoria A. Sablina
global P
if f ~= 1
set(P,'Visible','off')
end
x=-10:.125:10;
y = [linspace(1,1.2,24) linspace(1.2,1,24)];
[X,Y,Z]=meshgrid(x);
V=(X.^2+9/4*Y.^2+Z.^2-1).^3-X.^2.*Z.^3-9/80*Y.^2.*Z.^3;
P = patch(isosurface(X*y(f),Y*y(f),Z*y(f),V,0));
isonormals(X,Y,Z,V,P);
P.FaceColor = 'r';
P.EdgeColor = 'none';
daspect([1 1 1])
view(3);
if f == 1
axis(1.5*[-1 1 -1 1 -1 1]);
camlight
axis off
end
lighting gouraud
end
Animation
Remix Tree