% modified from Professor Militzer's code for a Menger Sponge

clear
clf

L = 1;

hold on;

n=3
sponge(n,[0;0;0],L,'r');

view([30,25]);
grid on;

camlight(135,180);
set(gca,'PlotBoxAspectRatio',[1 1 1]);

f = n*100;
% Do a 360 degree rotation at the end
for k = 1:8:180
    f=f+1;
    view([-134+k 14]);
    drawnow;
    %saveas(gcf, ['pyr',sprintf('%03d',f),'.png'])
end

