fractal tree

Hi does any one have good information (source code) on drawing a 3D fractal tree?


nVidia had a demo called TreeMark or something like that, for GF1-2 cards. It’s still avabile on their site with source code.

Thanks DarkWind. it is sure a very nice tree. A little too advance for me. :slight_smile:

I like the nvidia tree demo. Still looks neat to me. :smiley: Too bad they are using the slowest possible way to render as i’m only getting 7 million poly/sec on my GeForce FX 5600 Ultra. Of course I can always fix that once I get the code to compile.

Here is another link to a pretty cool tree generator that is also open source. I doubt the code is any simpler to understand than nvidia’s tree demo but it’s still a nice program.


good paper on tree generation (used by TReal if i remember correctly (and many others as well)): ‘Creation and Rendering of Realistic Trees’ by Jason Weber & Joseph Penn … looks like there is a copy available here

Not really fractal, but makes pretty nice trees, if you don’t mind high poly counts :slight_smile: It isn’t too hard to tune them down to more useable ranges tho.

Your question is not about how to draw a tree, but how to generate a tree, so it does not have anything to do with OpenGL :wink: .

Creating such a tree is a fairly simple recursive algorithm: there is a line of a certain length and direction, at the end of the line, a random number of new lines are created which are smaller than the original line and which direction is rotated a little bit, and so on, and if a line’s length is below a certain threshold value, you call it a leave. Varying the parameters of this (number of new lines, length reduction factor, rotation angles) will give a lot of different vegetation.

GScape appears to have had a nice, procedural tree implementation. . . but it seems to have disappeared. All that’s left of the site ( is the documentation:

OT: Anyone know of a mirror to the editor? :slight_smile: