POV-Ray : Newsgroups : povray.binaries.images : Block coded in PovRay : Re: Block coded in PovRay Server Time
2 Aug 2024 06:18:18 EDT (-0400)
  Re: Block coded in PovRay  
From: Trevor G Quayle
Date: 6 Feb 2008 13:05:00
Message: <web.47a9f60f15c6d867c150d4c10@news.povray.org>
Been having a little fun with this today.  A slight modification I have made,
converting the pattern to a function to evaluate directly rather than building
a heightfield for each layer.  Depending on the resolution, this can have a
little bit of an impact on parse time as it takes time to build the
heightfield, even if it isn't rendered.  It seems to produce similar results,
but I can get it exact, likely only because of not getting the right
orientation/location of the pattern being evaluated. (and a slight change in
the way I set up the while loops, but you can ignore that).

#declare f_hf= function{
  pattern{
    agate
    turbulence chaos
    scale resolution
  }
}

#declare bloks=
union{
  #declare zet=1;#while (zet<=resolution)
    #declare iks=1;#while (iks<=resolution)
      #declare ueps=1;#while (ueps<=resolution)
        #if (f_hf(iks,zet,ueps)>(1-densiti))
          box{-0.4,0.4 translate<iks,zet,ueps>}
        #end
      #declare ueps=ueps+1;#end
    #declare iks=iks+1;#end
  #declare zet=zet+1;#end
}


-tgq


Post a reply to this message

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