#### Archived

This topic is now archived and is closed to further replies.

# Math for surface

This topic is 5603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, Where can I find a place with math functions that enable you to apply them on a flat surface and create hills and other strange stuff? Thanks.

##### Share on other sites
There are two really popular ways to generate hills and stuff (commonly known as terrain). The first way is to use a paint package (Paint Shop Pro, Photoshop, etc.) to create an image that represents a heightfield. That is, the pixel color represent the height of the point. For a greyscale image with 8 bits per pixel, that'd give you 256 levels of height. You can also use RGB images. It is common to use R to represent the low byte of a short integer and green to represent the high byte, to achieve 65536 (216) levels of height. You can create a planar grid mesh, then displace each vertex in the Z direction by sampling from the heightfield.

The other approach, to generate hills and stuff algorithmically (rather than via painting) is to use fractals. You can create some very cool stuff this way, but you have much less control over where the hills go. Look at the Pandromeda website (link below), browse the gallery, and be AMAZED !

Pandromeda is a company which sells a fractal landscape generation package called MojoWorld Generator that is PHENOMENAL . Highly recommended for playing with fractal terrain generation. But not free and you don't get code.

www.pandromeda.com

For more useful stuff with code, I did a search using our friend google, and came up with these:

Here's a good powerpoint presentation that starts you out slow---a good place to start
www.cs.wisc.edu/~schenney/courses/cs638-f2001/lectures/cs638-14.ppt

The "Gems" referred to in the slides is the Game Programming Gems book from Charles River Media. Some figures are not contained in the slides to avoid copyright issues. You'd have to purchase or borrow (from a library or friend) a copy of the book to see those pictures.

www.gameprogrammer.com/fractal.html

There is also always the VTerrain website's page on artificial terrain generation:

www.vterrain.org/Elevation/artificial.html

Google found over 6,000 web pages when I searched on "fractal terrain generation." So you can explore to your heart's content.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

[edited by - grhodes_at_work on March 18, 2003 10:10:03 PM]

[edited by - grhodes_at_work on March 18, 2003 10:10:38 PM]

1. 1
2. 2
3. 3
Rutin
24
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002228
×