|
![](/i/fill.gif) |
High!
Together with a friend who is re-discovering PoV-Ray after several years
with Blender, I'm programming a fictitious (but at least halfway
scientifically accurate) extrasolar planetary system. Currently, I'm
trying to model asteroid-like small moons; as we want their surfaces to
be realistic (and keep the memory used low), we turned to isosurfaces
rather than meshes.
The first image attached shows a moon before applying any craters, it's
a standard ellipsoid function with added large-scale noise:
f_ellipsoid (x, y, z, 1, 1/(9/20), 1/(14/20))+f_noise3d(x, y, z)/1.7-1
In the second image I added a "craters" function consisting of four
crackle (form <n, 0, 0>, the x component is varied to get different
crater densities) functions multiplied together, each representing a
"layer" of craters of different sizes:
f_ellipsoid (x, y, z, 1, 1/(9/20), 1/(14/20))+f_noise3d(x, y,
z)/1.7-1-craters(x*2,y*2,z*2)
(the intended radii of the asteroidal moon are 20 by 9 by 14 kilometres)
with "craters" being
#declare craters=
function { crater_layer_1(x, y, z).gray*crater_layer_2(x, y,
z).gray*crater_layer_3(x,y,z).gray*crater_layer_4(x,y,z).gray*crater_layer_5(x,
y, z).gray }
Strangely, the subtracted craters function not only added craters, but
also doubled the overall size of the asteroid...
So I decided to cut the scale factor by half, and as the craters
appeared to be bottomless dark holes, I made them much shallower by
setting the darkest part of the crackle color_maps to 0.95 instead of 0
or 0.5. Finally, I added a fifth layer of many very small craters, so
that the whole isosurface formula complex is now:
#include "functions.inc"
#declare crater_layer_1=
function
{
pigment
{
crackle
form <1.5, 0, 0>
color_map
{
[0.05 rgb <0, 0, 0.95>]
[0.2 rgb <1, 1, 0>]
}
}
}
#declare crater_layer_2=function
{
pigment
{
crackle form <1.5, 0, 0>
color_map
{
[0.05 rgb 0.95]
[0.2 rgb 1]
}
translate y*2
}
}
#declare crater_layer_3=function
{
pigment
{
crackle form <1.2, 0, 0>
color_map
{
[0.05 rgb 0.95]
[0.2 rgb 1]
}
translate <4, 51, 4>
scale 0.4
}
}
#declare crater_layer_4=function
{
pigment
{
crackle form <1.8, 0, 0>
color_map
{
[0.05 rgb 0.95]
[0.2 rgb 1]
}
translate <4, 51, 4>
scale 1.6
}
}
#declare crater_layer_5=function
{
pigment
{
crackle form <1.45, 0, 0>
color_map
{
[0.05 rgb 0.95]
[0.2 rgb 1]
}
rotate x*20
scale 0.1
}
}
#declare craters=
function { crater_layer_1(x, y, z).gray*crater_layer_2(x, y,
z).gray*crater_layer_3(x,y,z).gray*crater_layer_4(x,y,z).gray*crater_layer_5(x,
y, z).gray }
isosurface // Moon #4j; irregularly shaped asteroidal body
{
function { f_ellipsoid (x, y, z, 1, 1/(9/20), 1/(14/20))+f_noise3d(x,
y, z)/1.7-1-craters(x*2,y*2,z*2) }
threshold 1
contained_by { box { -100, 100 } }
accuracy 0.0001
max_gradient 20
texture
{
pigment { color rgb <0.6, 0.6, 0.6> }
finish { Standard }
}
scale 10
translate Pos_4j
}
But the resulting scene is still pretty far from a real asteroid, I
think... for comparison, I added an image from the 2000/01 NASA NEAR
mission to asteroid Eros.
On a real asteroid, you find crater formations in all stages of
degradation by micro-impact erosion, with younger craters obliterating
the older ones. And when looked upon close, even young craters don't
have razor-sharp rims, but are softened.
I doubt whether simply adding small- to medium-scale noise will do the
trick... is there a way to modify the crackle function itself (which,
unfortunately, is not documented in the PoV-Ray on-screen manual) to
produce less sharp-rimmed craters? And how do I get the craters really
obliterating older ones instead of just adding up to the existing relief?
See you in Khyberspace!
Yadgar
Now playing: Whipping Boy (Elton John)
Post a reply to this message
Attachments:
Download '4j_flight000.png' (25 KB)
Download '2006-06-21_michatopia_moon_.jpg' (14 KB)
Download '2006-06-22_michatopia_moon_.jpg' (9 KB)
Download '20000317.jpg' (93 KB)
Preview of image '4j_flight000.png'
![4j_flight000.png](/povray.binaries.images/attachment/%3C449b3fb4%40news.povray.org%3E/4j_flight000.png?ttop=443866&toff=4400&preview=1)
Preview of image '2006-06-21_michatopia_moon_.jpg'
![2006-06-21_michatopia_moon_.jpg](/povray.binaries.images/attachment/%3C449b3fb4%40news.povray.org%3E/2006-06-21_michatopia_moon_.jpg?ttop=443866&toff=4400&preview=1)
Preview of image '2006-06-22_michatopia_moon_.jpg'
![2006-06-22_michatopia_moon_.jpg](/povray.binaries.images/attachment/%3C449b3fb4%40news.povray.org%3E/2006-06-22_michatopia_moon_.jpg?ttop=443866&toff=4400&preview=1)
Preview of image '20000317.jpg'
![20000317.jpg](/povray.binaries.images/attachment/%3C449b3fb4%40news.povray.org%3E/20000317.jpg?ttop=443866&toff=4400&preview=1)
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
=?ISO-8859-1?Q?J=F6rg_=27Yadgar=27_Bleimann?= <yaz### [at] gmx de> wrote:
> But the resulting scene is still pretty far from a real asteroid, I
> think... for comparison, I added an image from the 2000/01 NASA NEAR
> mission to asteroid Eros.
>
> On a real asteroid, you find crater formations in all stages of
> degradation by micro-impact erosion, with younger craters obliterating
> the older ones. And when looked upon close, even young craters don't
> have razor-sharp rims, but are softened.
>
> I doubt whether simply adding small- to medium-scale noise will do the
> trick... is there a way to modify the crackle function itself (which,
> unfortunately, is not documented in the PoV-Ray on-screen manual) to
> produce less sharp-rimmed craters? And how do I get the craters really
> obliterating older ones instead of just adding up to the existing relief?
>
> See you in Khyberspace!
>
> Yadgar
>
> Now playing: Whipping Boy (Elton John)
I suggest you find (or render) height data of craters, then apply the image
as a map to your iso-ellipsoid.
Here's my macro for rendering planets using height data.... Although it
applies to spheres, I think some modifications to it can be applied to
ellipsoids.
#macro LandSurface(_radius, _hirelief, _lorelief, _albedo,
_landmapimagetype, _landmap, _landbumpimagetype, _landbump)
#local _planetradius=_radius*unitscale;
#local _planethirelief=_hirelief*unitscale;
#local _planetlorelief=_lorelief*unitscale;
#local _planetdelta=_planethirelief-_planetlorelief;
#local fn_PlanetBump=function{
pigment{
image_map{
map_image(_landbumpimagetype, _landbump)
map_type 1
//once
interpolate 2
}
}
}
isosurface
{
function {
f_sphere(x, y, z, (_planetradius+_planetlorelief))-(fn_PlanetBump(x, y,
z).red*_planetdelta)
}
contained_by {
sphere{
0,(_planetradius+_planethirelief)
}
}
accuracy surface_accuracy*unitscale
evaluate 0.6 5 0.7
texture
{
pigment
{
image_map
{
map_image(_landmapimagetype, _landmap)
map_type 1
}
}
finish
{
ambient 0
brilliance land_brilliance
albedo(_albedo)
}
}
}
#end
#declare jpeg_type = 100;
#declare png_type = 200;
#declare gif_type = 300;
#macro map_image(image_type, image_name)
#switch (image_type)
#case (jpeg_type)
jpeg image_name
#break
#case (png_type)
png image_name
#break
#case (gif_type)
gif image_name
#break
#end
#end
Post a reply to this message
|
![](/i/fill.gif) |