• Remix
  • Share
  • New Entry

on 30 Oct 2021
  • 2
  • 18
  • 0
  • 0
  • 280
% Trying to make a random 3D surface for a planet
% Starscape
r=@()rand(1,2e3);
scatter(r(),r(),r()*30,'.w');
set(gca,Po=[0
0
1
1],Color='k')
N=315;
a=-pi:0.02:pi;
g=abs(ifft2(randn(N)./abs(a+i*a').^1.8));
[x,y,z]=sph2cart(a,a',rescale(g,0,1.2));
hold
Current plot held
[t,u,v]=sphere(N);
surf(x,y,z);
axis off equal
surf(t,u,v,ones(N).*cat(3,0,.5,1));
view([-26,45])
shading flat
light
Remix Tree