POV-Ray : Newsgroups : povray.binaries.scene-files : Blob modelling : Blob modelling Server Time
3 Sep 2024 02:20:51 EDT (-0400)
  Blob modelling  
From: Edward C 
Date: 24 May 1999 21:35:56
Message: <3749f06c.0@news.povray.org>
I've been getting into blobs, and I've come up with this nice macro for
spherical components.  You pass a position vector, core radius, goop radius
and texture.  The core radius is the radius of a 'solid' core - with no
other components present (and threshold set to 1 as I always have it), you
would get a sphere of radius = core radius.  The goop radius is the radius
of the 'sphere of influence' - i.e. how far away the field extends from the
centre.  For me, this macro offers a more intuative method for building with
blobs - although you don't always want your components to have a solid core,
so some have to be added manually.
If anyone else has/knows of good tools for blobs, or wants a modification or
clarification of my macro, please post.

The macro is:

#macro blobbit(pos, corerad, gooprad, stuff)
  sphere {
    pos, gooprad, pow(1-pow(corerad/gooprad, 2),-2)
    texture {
      stuff
    }
  }
#end

Below is a scene using the blobbits:

#version 3.1;

global_settings {
  assumed_gamma 1.0
  ambient_light 0.5
}

camera {
  location  < 0.00, 3.00,-5.00 >
  look_at   < 0.00, 1.00, 0.00 >
}

light_source {
  <-30.0, 25.0,-20.0 >
  color < 1.00, 0.80, 0.80 >
}

light_source {
  < 10.0, 25.0,-20.0 >
  color < 0.80, 1.00, 0.80 >
}

plane {
  < 0, 1, 0 >, 0
  texture {
    pigment {
      checker
      color 0.5*< 1.00, 1.00, 1.00 >
      color 0.5*< 0.00, 0.00, 1.00 >
      scale 0.1
    }
  }
}

#declare shiny = finish {
  specular 1.00
  roughness 0.013
  reflection 0.03
  metallic
  diffuse 0.1
  brilliance 10
}

#declare bumpy = normal {
  bumps
  scale 0.05
}

#declare shinyred = texture {
  pigment {
    color < 1.00, 0.00, 0.00 >
  }
  finish {
    shiny
  }
  normal {
    bumpy
  }
}

#declare shinygreen = texture {
  pigment {
    color < 0.00, 1.00, 0.00 >
  }
  finish {
    shiny
  }
  normal {
    bumpy
  }
}

#declare shinyblue = texture {
  pigment {
    color < 0.00, 0.00, 1.00 >
  }
  finish {
    shiny
  }
  normal {
    bumpy
  }
}

#declare shinygrey = texture {
  pigment {
    color < 0.33, 0.33, 0.33 >
  }
  finish {
    shiny
  }
  normal {
    bumpy
  }
}

#macro blobbit(pos, corerad, gooprad, stuff)
  sphere {
    pos, gooprad, pow(1-pow(corerad/gooprad, 2),-2)
    texture {
      stuff
    }
  }
#end

blob {
  blobbit(<-1.00, 0.00, 0.00 >, 0.70, 1.55, shinyred)
  blobbit(< 1.00, 0.00, 0.00 >, 0.70, 1.55, shinygreen)
  blobbit(< 0.00, 0.00,-1.73 >, 0.70, 1.55, shinyblue)
  blobbit(< 0.00, 1.63,-0.58 >, 0.70, 1.55, shinygrey)
  threshold 1.00
  hierarchy 1
  sturm 1
  translate < 0.00, 1.00, 0.00 >
  rotate < 000, 045, 000 >
  texture {
    pigment {
      color < 1.00, 0.00, 0.00 >
    }
    finish {
      specular 1.00
      roughness 0.013
    }
  }
}


Post a reply to this message

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