I would like to make fractal tree in Unity3d, omitting branch angles and lengths, just to instantiate cubes as a tree, like 2,4,8,16... i look for solution all day and i figure it could take me days yet? Should i use an array to store and recall a list of coordinates that each new branch should be at? would it contain 2 or 16 values?
Here is an interactive JS code for trees: http://www.processing.org/learning/topics/tree.html
It uses the following code, please bypass the canvas, rotations, stalk length, i'd be so happy to just have a tree like in the image.
here is my funny attempt thus far:
Try this as a staring point:
Put the script on an empty game object. Drag in the parent (you can modify it later to instantiate or whatever), and drag in your cube prefab.
The function above is called recursively on the new corners; the depth value makes sure it is not called indefinitely.
answered Jul 21 '11 at 07:27 AM
Here is a JS version of your C# script:
answered Sep 06 '11 at 05:19 PM