Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Augusto, posted on January 04, 2002

Image Description, by Augusto

Well, this is my little contribution to the IOTD. I've had to program a little application that allows you to describe an L-System for a subject I've got. An L-System is a kind of grammar that can be used to describe the shape of trees.

The picture shows four trees I've obtained with simple grammars, and this technique seems to be very powerful. The application has two weeks of life since I started it, and it was proposed to make us learn a bit of OpenGL, so it's drawing techniques are pretty awful, but I like the results. (It was my first experience with OpenGL).

I encourage anybody to download the source code from and to improve it. It has a lot to be done, such as variable width of branches, texturing, etc. In this URL there is a brief explanation about how to write grammars (in spanish :( ).

Feel free to contact me by e-mail, if you liked it, or if you want to modify it.

Merry XMas and a happy new year.


PS: The source is for Linux, using LessTif (I had to make it work on a Sun machine with Motif), and MesaGL. Perhaps you will have to modify the makefile to compile it....

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
Ben Hanson

January 04, 2002, 02:44 PM


Neil Edelman

January 04, 2002, 02:50 PM

Looks cool. How fast does it go?


January 04, 2002, 03:07 PM

L systems are not supposed to be real time. You can use them to build trees at level load time. For instance to avoid having to store an entire model of a tree, you store a simple string, which is parsed using the L-system grammar to produce a tree.
It is a really really cool idea, and the amount of variation possible using these simple grammars is amazing.
Im sure google has a lot about L-Systems, otherwise look in CG: Principles and Practise for a better explanation.


January 04, 2002, 03:30 PM

Cool indeed
L-systems are the ultimate way to create realistic VR imho.


January 04, 2002, 05:25 PM

Indeed it is cool, but lsd is definitely the ultimate way to create realistic VR.


January 04, 2002, 06:13 PM

lsd? I've never heard of that technology.

:?) eheh! eheh! ohhhhhh...


January 04, 2002, 07:03 PM

Pretty, Nice, Wonderful. A really incredible IOTD, Yeah!

(note that this guy is my classmate and I must be fine with him XD)

What about mixing this wonderful tree models with a Brownian Fractal Motion or Fast Fourier Transform generated terrain?
Stop using plain green triangles to model the leafs!! PUAJJJJ!!!
What about some fruits on the trees?
And implementing some real time effect like wind movement or something like this?
I will also like a port to GBA, I'm not aimed to do so.
Is there some devilish-internal mechanism to convert the given grammar to a Greibach o Chomsky grammar?
Is there some label that indicates if the tree is regular or context-free?

(note that he's also friend of mine and I must be a bad boy, just a little XD)

Well, I will like to be the privileged first viewer of your second OGL production. This is fine but I bet you can do it much better. Sure!


January 04, 2002, 08:50 PM

I'm also study with this GL-MASTER, and that implies I must praise his work... or at least say something about it :-)
Also pointed by Danthalas, maybe it's a good idea to solve the lack of detail of your work. I liked the idea of some fruits, and i recommend enviroment-mapping to give real appearance to some pretty apples, or bump-mapping for those pineapples that you liked so much in the past (remember "Los Fruitis"? *). I suggest some birds hanging around between the branches and of course, some worms to feed them. The worms animation should be handled by an inverse kinematics system, nothing special, and some skeletal animation for the bird should be ok. Both birds and worms's excrements could be rendered using an enhanced Flocks particle system.
Last but not least, a real-time LOD algorithm will make things easy when you finally decide to throw away your impressive-awesome-gorgeous last generation tile-based 2d engine and go with real man stuff and implement that doom3-like 3d engine you always are talking about.
And what about those geforce3 extensions? I'm still waiting them... Maybe it's that you prefer Radeon specific stuff and go with Truform to give more volume to your creation...

Now that you are da real and only opengl man, it's time to upgrade your pitiful developing machine. So that you can aspire to kick my ass on the next quake party...(you'll never be able to beat me in Quake III, but dreaming is free, doesn't it? :DDD )


* Note for the non-spanish: "Los Fruitis" was a cartoon series based on fruit-like characters with speaking habilities. The main character was a pineapple called "Gazpacho" (spanish food, delicious), and was an idol for many kids, Augusto among them (just kidding :-))) )


January 05, 2002, 12:47 AM

I was first introduced to L-systems at SIGGRAPH 99 (I think that's the year in case anyone wants to look it up...), and they're pretty amazing things. The presentation was by a guy at Digital Domain who was working on the intro sequence for a little project called Fight Club.

The zoom-out of the brain to the barrel of a gun sequence was created using L-systems, and it was created by a guy at DD in collaboration with neuroscientists at some universities in California to be the most accurate representation of the brain ever...going much smaller than any imaging technology would allow. It's supposedly the real deal...not just a pretty effect for a movie...if you knew neuroscience you could probably gain some new insight into the field just by watching the movie. He essentially grew a brain, much to the dismay of those who needed the computers to render.

If someone has the DVD of it, I think they make quick mention of L-systems in the features, but I could be mistaken there.

I'm pretty sure that the big tree in the dream sequence of "What Dreams May Come" was created using L-systems, also by DD. Portions of it anyway, as it was impractical to do all of it. The director wanted a very specific type of tree that would have been extremely difficult to model for what was required of it, so they just grew it instead (introducing a host of new rendering problems if I'm not mistaken...). If you've seen the movie you know what I'm talking about.

Amazing stuff. Long live SIGGRAPH.


January 05, 2002, 01:20 AM

sweet stuff. been meaning to code a simple L-System renderer. Maybe I'll base on this.


January 05, 2002, 05:13 PM

LoL :D
I wouldn't know..

zed zeek

January 08, 2002, 03:16 PM

ive been playing around with l-grammers meself definitly they are pretty cool

This thread contains 12 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.