POV-Ray : Newsgroups : povray.advanced-users : Lunar crater with isosurfaces ? Server Time
25 Nov 2024 03:51:35 EST (-0500)
  Lunar crater with isosurfaces ? (Message 1 to 5 of 5)  
From:  Light Beam 
Subject: Lunar crater with isosurfaces ?
Date: 18 Sep 2003 12:44:45
Message: <3f69e0fd$1@news.povray.org>
Can somebody help me to do this ?! I've uded a cylindrical pigment to make
it but I don't know how to make it softly (soft edges of the crater) and
combine with anothe function to replace crater's edge by rocks or collapsed
edge... Thanks


Post a reply to this message

From: Christoph Hormann
Subject: Re: Lunar crater with isosurfaces ?
Date: 18 Sep 2003 14:27:32
Message: <vvcp31-068.ln1@triton.schunter.etc.tu-bs.de>
_Light_Beam_ wrote:
> Can somebody help me to do this ?! I've uded a cylindrical pigment to make
> it but I don't know how to make it softly (soft edges of the crater) and
> combine with anothe function to replace crater's edge by rocks or collapsed
> edge... Thanks

You can try modellling the crater with a spline function and use it like:

function {
   y - f_spline_crater(f_r(x, 0, z)).x
}

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 2 Sep. 2003 _____./\/^>_*_<^\/\.______


Post a reply to this message

From:  Light Beam 
Subject: Re: Lunar crater with isosurfaces ?
Date: 18 Sep 2003 15:30:00
Message: <3f6a07b8@news.povray.org>
Ok, but I'm a newby with this kind of functions, have you a little example ?


Post a reply to this message

From: Mike Williams
Subject: Re: Lunar crater with isosurfaces ?
Date: 18 Sep 2003 16:09:57
Message: <BGas$AA+9ga$Ew0Q@econym.demon.co.uk>
Wasn't it _Light_Beam_ who wrote:
>Can somebody help me to do this ?! I've uded a cylindrical pigment to make
>it but I don't know how to make it softly (soft edges of the crater) and
>combine with anothe function to replace crater's edge by rocks or collapsed
>edge... Thanks

I'd start from a mathematical function of two variables that looked
something like this (view with fixed width font)

                     _--_
____________________-    -________

and sweep it around the origin to create the crater shape.

I'd then add noise, and multiply the noise by the function itself, so
that the flat areas, where the function is close to zero, experience
little noise effect, but the crater rim experiences the full effect of
the noise.

Here's something you might use as a starting point.

It would probably look better with several noise functions at different
scales, with some small scale noise affecting the flat bits as well.


camera { location  <4, 30, -30> look_at <0, 0, 0>}

light_source {<-100,200,-100> colour rgb 1}
#include "functions.inc"

#declare R = 20;        // radius of contained by sphere
#declare Size=1/8;      // crater radius adjuster
#declare Sharp=40;      // sharpness adjuster
#declare Amp = 2;       // amplitude adjuster

#declare NS = 0.2;      // Noise inverse scale  
#declare NA = 1.0;      // Noise amplitude

// function of two variables that looks like a bump
#declare  F = function {pow(sin(x*Size),Sharp)*Amp}
                     
isosurface {
            // sweep it found the origin
  function { y-F(sqrt(x*x+z*z),y,z)
            // add some noise to the hig places
    -f_noise3d(x*NS,0,z*NS)*NA*F(sqrt(x*x+z*z),y,z)
  }
        open
        max_gradient 2
        contained_by{sphere{0,R}}
        pigment {rgb 1}
}

//--- end ---

If you want a crater with a central peak, you could start by changing
the "sin" into a "cos" and doubling the Size parameter.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From:  Light Beam 
Subject: Re: Lunar crater with isosurfaces ?
Date: 18 Sep 2003 16:32:37
Message: <3f6a1665@news.povray.org>
Oh, marvelous ! that's what I've expected ! Thank you !


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.