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:12:25 EDT (-0400)
  Re: a realistic algorithm for making a tree  
From: Tom Melly
Date: 15 Oct 2002 04:50:07
Message: <3dabd6bf$1@news.povray.org>
Justin,

You'll find a tree-generation macro included with:
http://www.tomandlu.co.uk/webres/raytracing/gallery/tmwinter.zip

This was used to create the tree in:
http://www.tomandlu.co.uk/webres/raytracing/gallery/pics/tmwinter.jpg

No leaves, I'm afraid, but it wouldn't be too hard to add them.

The approach I used was basically:

Generate a single branch by joining together blob components.

Whenever you generate a component, generate a random number and use to decide
whether to fork or not

If fork, then place the current vector in an array, and increase a pointer to
keep track of how many branch vectors there are.

If unprocessed branches exist, create a new branch starting from the stored
vector.


Post a reply to this message

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