POV-Ray : Newsgroups : povray.general : Mud Cracks : Re: Mud Cracks Server Time
1 Aug 2024 14:27:46 EDT (-0400)
  Re: Mud Cracks  
From: Mike Williams
Date: 18 Aug 2005 03:41:27
Message: <W1sZTBALqDBDFwOS@econym.demon.co.uk>
Wasn't it Anthony D. Baye who wrote:
>Can anybody suggest a method procedural method, (Not using an image 
>file) to create a pattern of mud cracks such as one might find in the 
>desert?
>
>I'd like to use an Isosurface for this, and I need to Use it in a 
>difference.
>
>For example, see: http://pespmc1.vub.ac.be/Photos/MudCracks.jpg

Here's something that might get you started in the right direction


camera { location  <0, 2, -4> look_at <0, 0.1, 0> angle 17}
light_source {<-100,100,100> colour rgb 1}

#declare P1=function{
  pigment{
    crackle 
    colour_map {[0 rgb 0][0.08 rgb 1]}
    turbulence 0.2
  }
}

#declare P2=function{
  pigment{
    crackle 
    colour_map {[0 rgb 0][0.025 rgb 1]}
  }
}

#declare Scale1=0.2;
#declare Scale2=0.07;
#declare Height1=0.03;
#declare Height2=0.01;
isosurface {
  function { y - P1(x/Scale1,0,z/Scale1).x*Height1
      - P2(x/Scale2,0,z/Scale2).x*Height2
  }
  max_gradient 12
  contained_by{box{<-1,-0.01,-1><1,(Height1+Height2)*1.01,1>}}
  max_trace 4
  pigment {rgb .9}
}
      
It's not fast, and small changes to the Scale and Height parameters can
require significant changes to the max_gradient.

The "max_trace 4" isn't actually required in this scene, but you'll need
it when you use it in your difference.


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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