POV-Ray : Newsgroups : povray.general : Constructing isosurface functions : Re: Constructing isosurface functions Server Time
29 Jul 2024 12:20:14 EDT (-0400)
  Re: Constructing isosurface functions  
From: Christian Froeschlin
Date: 15 Jul 2011 16:36:28
Message: <4e20a4cc$1@news.povray.org>
After seeing the animation in p.b.a, you can of course
try to generate interesting structure by exploiting pattern
functions based, e.g. on crackle.

Here is a sample how you can wrap a pattern around a sphere
and control locations where it should appear:


// This basically defines a repeating pattern
// of spherical cones wrapped around a sphere
#declare f_obj_depth = function
{
   pattern
   {
     spherical
     translate 1
     warp {repeat 2*x} warp {repeat 2*y}
     scale <0.005,0.005,1>
     warp {spherical dist_exp 0}
   }
}

// Some sort of bozo continents
#declare f_placement = function
{
   pattern
   {
     bozo
     translate 1
     scale <0.1,0.1,1>
     warp {spherical dist_exp 0}
   }
}

#declare f_placement_clipped = function
{
   select(f_placement(x,y,z)-0.5,0,2*f_placement(x,y,z)-1)
}

#declare f_planet  = function(x,y,z)
{
   f_sphere(x,y,z,1+0.04*f_placement_clipped(x,y,z)*f_obj_depth(x,y,z))
}

isosurface
{
   function { f_planet(x,y,z) }
   contained_by { box {<-2,0,-2>,<2,2,2>} }
   accuracy 0.001
   max_gradient 2
   pigment {color White}
   scale 2
}


Post a reply to this message

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