- /
-
Colorful bubbles
on 16 Oct 2021
- 4
- 12
- 0
- 0
- 265
colormap(1-turbo(256))
[x,y,z]=sphere(181);
[v,b,n]=meshgrid(0:4);
t=2*v+rem(b+n,2);
u=sqrt(3)*(b+rem(n,2)/3);
p=2*sqrt(6)*n/3;
g=surf(x,y,z);
light
shading interp
for i=1:125
q=copyobj(g,gca);
q.XData=x+t(i);
q.YData=y+u(i);
q.ZData=z+p(i);
end
axis equal off tight
set(gca,'Pos',[0 0 1 1])