I'd like to seed a void map with "branches" of sine waves or any other waveform. Something like:
Know of any algorithm? Has to be one to generate trees or something like that.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI'd like to seed a void map with "branches" of sine waves or any other waveform. Something like:
Know of any algorithm? Has to be one to generate trees or something like that.
What is the ultimate purpose of this algorithm supposed to be? Do you want to generate random roads? Branches for a tree? In 2D or 3D space?
The best approach might be to put a bunch of random points on the map, then do a minimum spanning tree. You can then use quadratic or cubic interpolation to make the lines curve into eachother.
Alternately, if you want to generate a tree-like structure in 3-space, you should investigate quaternion rotations, and rotating points about an abitrary axis.
If the your usage is creating landscape (or trees themselves) you can also look into fractal generating algorithms for example:
http://en.wikipedia.org/wiki/Pythagoras_tree_(fractal)
en.wikipedia.org/wiki/Fractal