• Remix
  • Share
  • New Entry

on 12 Oct 2021
  • 12
  • 94
  • 0
  • 0
  • 280
% Sunset background
q=1:.5:50;
imagesc(q'.*(q./q),[5,70])
colormap hot
hold on
axis equal off
% Raindrops
[x,y,z]=sphere(99);
y(y<0)=NaN; % Flatten raindrops on window surface
[a,b]=ndgrid(3:3:96); % Gridded raindrop positions
s=randg(6,size(a))/10; % Raindrop sizes
for i=randperm(992,250) % Select some drops; in randperm(n,m), n=numel(a) and m is the number of drops to render
t=s(i);
surf(t*x+a(i)+rand*2-1,1.5*t*z+b(i)+rand*2-1,t*y,FaceC='w',FaceA=.7,EdgeC='n')
% ^^^ sets the vertical stretch of each drop
end
L=light(Po=[0,1,.1]); % Dark tops and light bottoms
material dull
Remix Tree