POV-Ray : Newsgroups : povray.binaries.images : Towards a procedural tree macro (62kbbu) : Towards a procedural tree macro (62kbbu) Server Time
2 Oct 2024 20:22:35 EDT (-0400)
  Towards a procedural tree macro (62kbbu)  
From: Greg M  Johnson
Date: 25 Mar 2000 22:50:10
Message: <38dd88f2@news.povray.org>
I've seen some tree makers here which are breathtaking in their visual
beauty.  I think that the coolest alorgithm for a tree, however, would
be procedural and not involve lots of translate & rotate statements.

Here's my first stab at a procedurally derived tree.  Further
experimentation underway.  Feel free to take this and improve it.

#declare rag=function{ 1/(x^2+y^2+z^2)^0.5*5}   // 35;
#macro Treegent(gent,tx,ty,tz)
//gent is currently useless randomizer,  translate to tx, ty, tz
union{
 isosurface{
         function{
noise3d((x+gent)/rag,(y+gent)/rag,(z+gent)/rag)&(-y-1) }
                accuracy .001
                threshold  .01
         contained_by {sphere{0,15} }
         bounded_by   {sphere{0,2 } }
                }
 isosurface{
         function{  noise3d((x+gent)/rag,(y+gent)/20/rag,(z+gent)/rag)}
                accuracy .001
                threshold  .08
         contained_by { sphere{0,5} }
         bounded_by   { sphere{0,1} }
                   }
 pigment{
         spherical
  pigment_map{
                 [0      Green]
                        [.2     Brown]
                        [1     Brown]
                          }
                scale 12
                }
        finish{ambient 0.1}
        translate <tx,ty,tz>
        }
  #end


Post a reply to this message


Attachments:
Download 'noiseforest2.jpg' (62 KB)

Preview of image 'noiseforest2.jpg'
noiseforest2.jpg


 

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