vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: Random Terrain Generation - View Topic
Topic Rating: *****
Printable View
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 31
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Random Terrain Generation (7th Feb 09 at 6:18pm UTC)


This is the project I undertook for my Computer Science class first semester. It randomly generates a landscape using an algorithm known as MPD (MidPoint Displacement).

The way it works is that the 4 corner points are randomly set. Next the point in the middle of those 4 are set by taking the average of the 4 corner points, and adding/subtracting a random value.

Next you set the point in the middle of two corners and the middle point, again using the average plus or minus a (smaller) random displacement.

This continues until every point has been set.

I took this project on with very limited knowledge of C++, and learned a lot as time went on. For my first major challenge using a new language, I think I did very well.

There are still quite a few things that are buggy, such as the shading, but I am working on getting all bugs fixed.

The only things you need to worry about in this program are the "Max Displacement" and the "Artifact Indifference". The "Max Displacement" is the highest random value that can be used to set a point's height. The "Artifact Indifference" looks for any point that for whatever reason is at least a certain height higher than all those around it, and redefines its height, making the landscape flow more smoothly.

Thoughts? Comments? {Grin}

rroll.to— Shorten a link, rickroll your friends.
dog199200
Guest
Re: Random Terrain Generation (8th Feb 09 at 1:10am UTC)
its good for a start by looking at the images, but you might wnat to add in a texturing system and a map shaping tool or two and maybe an 3D extraction tool later on {Tongue Out}
Marc
vChat Developer
*****
I <3 Rossy

Posts: 3,388
Status: Offline
Gender: Male
Location: Ontario, Canada
Age: 31
Joined:  

Additional Groups:
Coding Team
***


Reputation: 40%  


pmwww
Re: Random Terrain Generation (8th Feb 09 at 5:31am UTC)
The main point of this assignment was to get a feel for OpenGL and GLUT; I may add a texturization system, but I can't see myself ever using the other two.

rroll.to— Shorten a link, rickroll your friends.
 Printable View

All times are GMT+0 :: The current time is 10:10pm
Page generated in 1.5974 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums