• Remix
  • Share
  • New Entry

on 11 Oct 2021
  • 22
  • 144
  • 2
  • 0
  • 148
figure(Color='k')
axes(Color=[1 .87 .68])
hold on
colormap copper
camva(3)
view([9.5,16,0])
h=randg(1,60); % building heights
h(:,[3:8:60])=0;
h([3:8:60],:)=0;
b=bar3(h);
axis equal
% g=.13; % height and width of windows
% [m,k]=ndgrid(1:25); % (x,y) building indices
% for i=1:10000 % loop through each building
% Interpolate building color according to building height
% Ideally this should be outside the loop but that would require more characters
% q=b(m(i));
% set(q,'CData',q.ZData,'FaceC','i');
% for j=1:2 % loop through each column of windows
% L=k(i)-.27+(j-1)*.37; % in k-a+(j-1)*b, a is the signed distance from center of building in row k(i) to left edge of window in column j and b is the interval between left edges of windows.
% x=L+[0,g,g,0]'; % [L;R;R;L] edges of windows in building i, window column j
% z=ones(4,1)*(.2:.4:h(i)-.2)+[0;0;g;g]; % 4xn height of windows for n levels of windows; in a:b:c a is height of first row of windows, b is the interval between window-bottoms, c is height of tallest window.
% y=z*0+m(i)+.4; % 4xn location of front face of building
%
% % Plot windows for building i, column j
% patch(z*0+x,y,z,'y');
% end
% end
Image
Remix Tree