- /
-
Tellus
on 30 Oct 2021
- 7
- 63
- 6
- 0
- 280
% Trying to make a random 3D surface for a planet
% Starscape
r=@()rand(1,1e3);
scatter(r(),r(),r()*30,'.w');
set(gca,Po=[0
0
1
1],Color='k')
axes(colorm=summer);
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
[t,u,v]=sphere(N);
surf(x,y,z);
axis equal off
surf(t,u,v,ones(N).*cat(3,0,.5,1));
shading flat