It looks like you're new here. If you want to get involved, click one of these buttons!
On Codea Community, I just uploaded a midpoint displacement algorithm for anyone that is interested. It could be used, for example, to procedurally generate backgrounds for side-scrolling games.
Something I've noticed: the random number generator seems to have very predictable patterns, as you may be able to see when moving the seed slider. Clearly the algorithm used could be better!
Comments
@Causeless Interesting program. Setting the passes to 5 and the roughness to .5 and sliding the seed back and forth reminds me of an electrical arc. The random number generator is a pseudo random number generator. The same seed will result in the same string of numbers. You can't write a program to create random numbers.
Haha, yeah, I was thinking it could make a lightning effect, too! The actual generation code runs perfectly at 60fps, even with 10 passes, it's just the line drawing that slows it down, btw.
I understand how random number generators work, I just mean, there's a clear and obvious pattern where there shouldn't be. With seed = n and seed = n + 1, the results should be significantly different, but here there is a clear colleration between the seed and the resulting pseudo-random numbers, and is predictable (incrementing the seed results in the random value incrementing too).
Speaking of using this algorithm for a lightning effect:
http://twolivesleft.com/Codea/Talk/discussion/1142/a-crappy-plasma-globe
@toadkick I totally missed that program back in June 2012. Nice effects. I wonder how I missed it.
Nice example. You can rewrite it using a mesh to keep the FPS higher.
Thanks! I've found in most places now that using any graphical drawing method other than mesh is unbearably slow, haha.
@Toadkick It's pretty cool, seeing the differences in implementation (you did a recursive appraoch, i did iterative).