• Remix
  • Share
  • New Entry

on 6 Nov 2023
  • 8
  • 18
  • 0
  • 1
  • 720
drawframe(1);
Write your drawframe function below
function drawframe(f)
if f==1
vertex=[0 0 0;0 0 1;0 1 0;0 1 1;1 0 0;1 0 1;1 1 0;1 1 1];
facet=[1 2 4 3;1 2 6 5;1 3 7 5;2 4 8 6;3 4 8 7;5 6 8 7];
faceColor=[.9,.9,.9];
for i=1:5,patch('Vertices',vertex+[i,3,0],'Faces',facet,'FaceColor',faceColor);end
for i=1:4,patch('Vertices',vertex+[1,3,i],'Faces',facet,'FaceColor',faceColor);end
for i=1:2,patch('Vertices',vertex+[1,3-i,4],'Faces',facet,'FaceColor',faceColor);end
vertex=[0 1 0;0 0 1;0 1 0;0 1 1;1 1 0;1 0 1;1 1 0;1 1 1];
patch('Vertices',vertex+[1,0,4],'Faces',facet,'FaceColor',faceColor)
ax=gca;hold on;axis off;light
ax.XLim=[0,6];
ax.YLim=[0,6];
ax.ZLim=[0,6];
ax.DataAspectRatio=[1 1 1];
set(gcf,'Color',[1,1,1])
end
v1=-39.2579+(f-1)./47.*(-45.1099+39.2579);
v2=6.8947+(f-1)./47.*(35.3223-6.8947);
view(v1,v2)
end
Animation
Remix Tree