• Remix
  • Share
  • New Entry

on 24 Nov 2023
  • 9
  • 14
  • 0
  • 0
  • 556
drawframe(1);
Write your drawframe function below
function drawframe(f)
K=[' xxx '
' xxxxx '
' xxxxx '
' xxx '
'xx xx'
' xx xxx xx '
' xxxxxxx '
' xxxxx '
' xxxxx '
' xxxxx '
' xxxxx '
' xx xx '
'xxx xxx'
' x x '];
[y,x]=find(~isspace(K));
C=[x*5,y*5]+5; C(:,3)=10;
nx=size(K,2)*5+10; ny=size(K,1)*5+10; nz=20; % Size of volume
[y,x,z]=ndgrid(1:ny,1:nx,1:nz);
vol=zeros(ny,nx,nz);
for i=1:size(C,1)
vol=vol+exp(-.05*((C(i,1)-x).^2 + (C(i,2)-y).^2 + (C(i,3)-z).^2));
end
S=isosurface(vol,.3*f/50);
newplot
patch(S,'FaceColor','#a56c3c','EdgeColor','none');
axis equal ij off
lighting gouraud
camlight
material([.6 .9 .3 ])
end
Animation
Remix Tree