Page 1 of 1
Fractal Tree
Posted: Tue Jan 20, 2009 6:40 pm
by kattle87
Well, we needed this for several purposes, and it was really fun for me to create the first ever Recursive Mesh in ZGE
http://en.wikipedia.org/wiki/Recursion_ ... r_science)
code is quite heavily commented. Basic idea is:
-Every time a Mesh is loaded, it automatically gets refreshed, meaning we can load the mesh inside the producer to compute it recorsively.
-Like we do in recursive functions, we calculate the two (or more) sub-problems, then we merge them (by adding the MeshBase and elaborating the whole).
-We use the TreeFlag array as a stack for knowing how much is the dept of the tree we are in. This is a quick and easy to understand solution. I could eliminate everything and only use the P variable but the stack will be handly later on. I use the P as a pointer for the stack current position.
-It's also quite fast for my sake: 4 seconds to elaborate a 9-levels tree (6k triangles)
free of context,. .
Posted: Tue Jan 20, 2009 7:05 pm
by jph_wacheski
haha,. yes! I had a dream about this,. your mental waves (or particles?) must have been arching far and wide my friend. I will have a look at the coding in a bit,. I simple must sort out the IG web site,. so I can get back to work building games,. I am so resistant to doing the stuff I don't so much like to do,. but once I start I offten get into it,.
the tree looks good and I am sure we can expand on this and generate a whole forest of twisted digital wild life,. keep hacking that math!
ciao
Posted: Tue Jan 20, 2009 7:28 pm
by kattle87
Of course, this is more a proof-of-concept rather then something I'm really gonna use

EG: the way sub-trees should be added is rotating them, not stretching on the left or the right
more info.s,.
Posted: Wed Jan 21, 2009 3:33 am
by jph_wacheski
must be serendipity,. but I was surfing around and hit on a site with a nice detailed procedural tree tutorial, not that you need help with this! your concept is working fine,. just thought I would point it out, in case he has some good ideas in there,. it is in freeBASIC so easy to read/adapt,.
cheers!
Posted: Wed Jan 21, 2009 7:38 am
by kattle87
uhm.... Name of the site?
BTW: I already have some ideas of how to use recursion to his real potential, will experiment in the next future.
Posted: Wed Jan 21, 2009 2:19 pm
by jph_wacheski
pocket forest 007
Posted: Fri Jan 23, 2009 3:21 am
by jph_wacheski
just a little bit more on that demo,. well a lot actually! I think this will become a game,. enentually I have a few ideas for it now, I'll see what develops. it pauses for a minuet when you run it as I am doing slightly randomized trees per the 80 or so models,.
I have just been hacking around with the settings but I think I will take a look at how this actually works and develop a wierder looking tree script,. I want real alien fealing stuff,. with 3 branches, i think.
Although these are quite cool already!
mouse to look around and RMB to get high,. . space to re-build the trees,. pauses! not much else to do yet.
Posted: Fri Jan 23, 2009 7:17 am
by VilleK
I like it

.
I think you are on to something very cool here jph, it'll be interesting to see what you can make of it.
dynamic L-system
Posted: Thu Feb 19, 2009 7:40 pm
by jph_wacheski
i guess this is related but a different ting,.i was just playing around with the idea of a dynamic growth system,. so plants/animals/robots/etc. could grow,. this is just a quick little test,. looks cool,. but I think I want to try a group of objects in a similar way so collisions can work and bits can be broken off,. .
Posted: Thu Feb 19, 2009 9:00 pm
by Kjell
Hey jph,
Make sure to use a Matrix stack so the rotation of parents can be taken into account easily as well ( right now only the last generation children are "active", but I imagine you'd want to take it a step further ).
K
Posted: Fri Feb 20, 2009 8:03 am
by VilleK
They look almost alive, as some kind of underwater microscopic germ lifeform
