- /
-
Midnight Marathon: Apartment Edition
on 12 Nov 2023
- 68
- 539
- 0
- 6
- 283
drawframe(1);
Write your drawframe function below
%Original: Adam 2021 MATLAB Mini Hack entry.
function drawframe(f)
axes(Color='k',Pr='p')
hold
h=ones(9,2)*2+.4; % building heights
b=bar3(h,.5);
set(b,FaceC=[.3,.3,.3]);
axis equal
camva(30)
campos([1.5 10 .2])
for i=1:9 %rows of buildings 1:size(h,1)
for j=1:2 %L/R buildings
c=.1:.2:h(i,j)-.2;
d=[c;c];
z=d(:)'+[0;0;.1;.1];
y=i-[15;5;5;15]*.01+[0,.2];
y=repmat(y,1,numel(c));
patch((.75+j/2*(z*0+1)),y+0.1*f,z,[.8,.8,.8])
end
end
camlight
end