Social Networks


Follow sproutworks on Twitter
Enter your Email


Powered by FeedBlitz

RSS Feed

Links

Blogshares Links

The BlogShares fantasy blog stock market.

BlogShares Price Tracker
I wrote this program to archive information from the BlogShares fantasy stock market. You can view graphs of any industry, and analyze your portfolio.

SproutWorks Projects

Digg Archive
A new experimental Digg page.
AJAX Pixel Editor
A Collaborative pixel editor currently in development.
Web promotion links
These tools help you get visitors on your website.
SproutPics
My photography Site
SproutSearch
I designed this blog indexing tool, and it has accumulated over 6 million blogs so far.
Products
Some of the programs I've written.
SproutTree Demo
A demo of a tree-drawing PHP script.
My Gallery

Sign In

Username:
Password:
Remember Me

sprout man
Forums/

sproutworks
January 30th, 2011 6:09 PM PST
The other day I read an article about how to create fractals using the midpoint displacement algorithm. It's a simple recursive algorithm where you take a square, and split it into 4 smaller squares while displacing the height of the corner where the 4 squares join by a random amount. This process is repeated, creating smaller squares which gradually make a smoother terrain.

I spent an hour or two writing a PHP script to make a terrain image using this method. After I got some decent looking greyscale images, I added a color map so I could create colored oceans and mountains.

Today I modified my old 3D graph script to generate 3D terrains using a bitmap and elevation map from my new fractal


Here is what it looks like:



sproutworks.com/artgraph.php?bitmap=image_1296466523.jpg&elvmap=elevation_1296466523.jpg&height=200


I might work on getting a terrain generator running in the iPhone, and rendering it with OpenGL.