POV-Ray : Newsgroups : povray.binaries.images : Towards a procedural tree macro (62kbbu) Server Time
2 Oct 2024 18:20:27 EDT (-0400)
  Towards a procedural tree macro (62kbbu) (Message 1 to 10 of 13)  
Goto Latest 10 Messages Next 3 Messages >>>
From: Greg M  Johnson
Subject: Towards a procedural tree macro (62kbbu)
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


 

From: mr art
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 25 Mar 2000 23:26:58
Message: <38DD91BA.60C27408@gci.net>
I love the look. I m going to give it a try.

"Greg M. Johnson" wrote:
> 
> 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
> 
>   ------------------------------------------------------------------------
>  [Image]

-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: TonyB
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 25 Mar 2000 23:30:20
Message: <38dd925c@news.povray.org>
Looks OK for bushes or background trees. Keep up the work. Good luck. :)


Post a reply to this message

From: Bill DeWitt
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 25 Mar 2000 23:39:42
Message: <38dd948e$1@news.povray.org>
"Greg M. Johnson" <"gregj;-)56590\""@aol.c;-)om> wrote in message
news: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.
>

    Not too shabby! Looks like an Orange Grove.

    I haven't tried to play with your code yet... looks like fun...


Post a reply to this message

From: mr art
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 25 Mar 2000 23:57:38
Message: <38DD98EB.B5596E93@gci.net>
Could you tell us what the value for gent you used in the posted scene?
All my attempts have given bad results, not at all like yours.
Thanks.

"Greg M. Johnson" wrote:
> 
> 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.
 

-- 
Mr. Art

"Often the appearance of reality is more important 
than the reality of the appearance."
Bill DeWitt 2000


Post a reply to this message

From: Bill DeWitt
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 26 Mar 2000 11:00:33
Message: <38de3421@news.povray.org>
"Greg M. Johnson" <"gregj;-)56590\""@aol.c;-)om> wrote :
>
> Here's my first stab at a procedurally derived tree.  Further
> experimentation underway.  Feel free to take this and improve it.
>

    Again, not too shabby. But I think that starting from this it will be
hard to improve it much. I would rather see something that is more like the
lparser system that can start from a basic trunk and then divides into
branches and twigs. Then you could use trace or something to put leaves on
it...

    I am really interested in this and am pounding away at it. But I have
little hope of accomplishing it. I can't get a division, not even a simple
Y... once I get that the rest should just be tedium.


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 26 Mar 2000 12:32:39
Message: <38de49b7@news.povray.org>
ZERO.
I initially thought I could get it to given randomized appearance of each
tree, but then realized that I was too lazy to code it that way. Lemme know
if zero gives you trouble.......

"mr.art" wrote:

> Could you tell us what the value for gent you used in the posted scene?
> All my attempts have given bad results, not at all like yours.
> Thanks.
>


Post a reply to this message

From: Greg M  Johnson
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 26 Mar 2000 12:47:10
Message: <38de4d1e@news.povray.org>
I chose the noise3d function because it has its own 'branchability' built into
it.
See the following image, with a slightly higher threshold, and a cross section
through the branches.



Bill DeWitt wrote:

> "Greg M. Johnson" <"gregj;-)56590\""@aol.c;-)om> wrote :
> >
> > Here's my first stab at a procedurally derived tree.  Further
> > experimentation underway.  Feel free to take this and improve it.
> >
>
>     Again, not too shabby. But I think that starting from this it will be
> hard to improve it much. I would rather see something that is more like the
> lparser system that can start from a basic trunk and then divides into
> branches and twigs. Then you could use trace or something to put leaves on
> it...
>
>     I am really interested in this and am pounding away at it. But I have
> little hope of accomplishing it. I can't get a division, not even a simple
> Y... once I get that the rest should just be tedium.


Post a reply to this message


Attachments:
Download 'noiseforest02.jpg' (43 KB)

Preview of image 'noiseforest02.jpg'
noiseforest02.jpg


 

From: SamuelT 
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 26 Mar 2000 16:36:13
Message: <38DE858D.B0B3FCF5@aol.com>
I'm thinking a marriage between standard pov objects for branches, and
isosurfaces for leaves might be the best we can do to make good, and hopefully
fast-rendering trees. I might have to try it. :)

"Greg M. Johnson" wrote:

> 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
>
>   ------------------------------------------------------------------------
>  [Image]

--
Samuel Benge

E-Mail: STB### [at] aolcom

Visit the still unfinished isosurface tutorial: http://members.aol.com/stbenge


Post a reply to this message

From: Lummox JR
Subject: Re: Towards a procedural tree macro (62kbbu)
Date: 26 Mar 2000 19:31:41
Message: <38DEAD4C.78E3@aol.com>
These trees would look just great in a background, I think; not as good
in the foreground, though.
Two small suggestions:

1) Turbulate the x, y, and z values just slightly based on their
distance from the center. This will give the trees a less hemispherical
look.
2) Change all n^2 to sqr(n) and n^0.5 to sqrt(n). As far as I can tell
from the function code, these should always be faster than using an
exponent.

I think I might give this a try in an old scene (where I wanted
background trees but settled for a textured height field) and see what
happens.

Lummox JR


Post a reply to this message

Goto Latest 10 Messages Next 3 Messages >>>

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