Jump to content
  • Advertisement


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.

If you intended to correct an error in the post then please contact us.

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 this post

Link to post
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.


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

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.


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


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]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!