POV-Ray : Newsgroups : povray.newusers : a realistic algorithm for making a tree : Re: a realistic algorithm for making a tree Server Time
4 Sep 2024 18:14:13 EDT (-0400)
  Re: a realistic algorithm for making a tree  
From: Christoph Hormann
Date: 14 Oct 2002 04:11:51
Message: <3DAA7C46.7F95EB5F@gmx.de>
Justin Smith wrote:
> 
> I'm trying to figure out how to code the trunk and branching structure of a
> normal deciduous tree. I took a look at some of the existing trees out
> there, and it seems that using blobs is the way to go. 
> [...]

Why do you think so?

Meshes are surely the most efficient way to generate trees.  Surely not
the most realistic, but you won't be able to generate a tree rendering in
agreeable time with isosurfaces anyway.

> Also, I am trying to get a feel for using blob-like combinations in an
> isosurface, but the following code won't work. What am I doing wrong?
> 
> [...]

Try:

isosurface
{
  #declare Blob_Threshold = .05; 
  #declare Seed=seed(0);
  #declare iter = 0;
  function
  {
    (1+Blob_Threshold)
    #while(iter < 50)   
      #declare Rnd1=rand(Seed);
      #declare Rnd2=rand(Seed);    
    
      -pow(Blob_Threshold,f_sphere(x-(Rnd1+.5),y-(iter/2),z-(Rnd2+.5),.3))
      #declare iter = iter + 1;
    #end
  }
  contained_by { box { -30,30 } }
  max_gradient 2.4
}

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

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