Questions tagged [terrain]

Terrain, or land relief, is the vertical and horizontal dimension of land surface. Terrain is used as a general term in physical geography, referring to the lie of the land. This is usually expressed in terms of the elevation, slope, and orientation of terrain features. In games, terrain is the "land" or "world" on which the game environment, roads, buildings, vehicles, characters are placed and interact with each other.

Terrain, or land relief, is the vertical and horizontal dimension of land surface. Terrain is used as a general term in physical geography, referring to the lie of the land. This is usually expressed in terms of the elevation, slope, and orientation of terrain features. In games, terrain is the "land" or "world" on which the game environment, roads, buildings, vehicles, characters are placed and interact with each other.

This tag is for question related to terrain, its properties, problems related to setting different properties, lighting, textures, simulating gravity, friction etc for use in games or simulations.

574 questions
100
votes
11 answers

Looking for a good world map generation algorithm

I'm working on a Civilization-like game and I'm looking for a good algorithm for generating Earth-like world maps. I've experimented with a few alternatives, but haven't hit on a real winner yet. One option is to generate a heightmap using Perlin…
FalconNL
  • 1,603
  • 2
  • 13
  • 17
38
votes
4 answers

Perlin Noise generation for terrain

I'm trying to implement some source code I found online to generate a height map using Perlin Noise. I've successfully managed to get the height map using the noise3 function, with the third coordinate being a random "seed", to allow for random…
Emma
  • 2,012
  • 5
  • 21
  • 30
29
votes
4 answers

Hide contour linestroke on pyplot.contourf to get only fills

I have a pet project to create images of maps, where I draw the roads and other stuff over a contour plot of the terrain elevation. It is intended to plan mountain bike routes (I have made some vectorial drawings by hand, in the past, and they work…
heltonbiker
  • 26,657
  • 28
  • 137
  • 252
28
votes
3 answers

Random 2D Tile-Map Generating Algorithm

Can anyone tell me a way to generate island structures or hill structures like in minecraft? I'm just searching for a proper THEORY for that random-shape generating, but it should keep a defined base pattern.. like: islands schould be rounded but…
Ace
  • 1,437
  • 6
  • 28
  • 46
23
votes
1 answer

OpenGL - How to calculate normals in a terrain height grid?

My approach is to calculate two tangent vectors parallel to axis X and Y respectively. Then calculate the cross product to find the normal vector. The tangent vector is given by the line that crosses the middle point on the two nearest segments as…
rraallvv
  • 2,875
  • 6
  • 30
  • 67
21
votes
2 answers

Creating Terrain Map with SRTM HGT File

I am working on an iOS application. Where I show the Elevation and Topography map of a certain area. I have managed to download the .hgt file within app from here. So far I am able to extract the Elevation from the hgt file. Now I have to also show…
superGokuN
  • 1,399
  • 13
  • 28
18
votes
1 answer

Mapping a height map to a grid-based contour format

I have a 2D height map in the following format 06 36 39 42 43 55 ... 37 40 43 43 45 46 ... 40 43 44 45 46 48 ... 44 44 46 47 48 50 ... 41 44 45 47 48 48 ... ... And I need to remap it into a grin based contour format (so it can further be mapped…
Sash
  • 4,448
  • 1
  • 17
  • 31
18
votes
2 answers

How to implement a Worms style destructible terrain in XNA?

I want to prototype an idea for a game I have. The idea for this game is that the player will dig through the ground, creating tunnels and finding treasure. I'm looking to create 'worms style' terrain, with collision detection for the player…
Spoonman
16
votes
2 answers

Is there an easy way to get shadows in OpenGL?

I recently created some landscape code and added some diffuse lighting to the scene, however, to my disappointment, there are no shadows. I looked around the web for hours looking for ways to get shadows in OpenGL, however they all seemed terribly…
user354346
15
votes
1 answer

Basic Dual Contouring Theory

I've been searching on google, but cannot find anything basic. In it's most basic form, how is dual contouring (for a voxel terrain) implememted? I know what it does, and why, but cannot understand how to do it. JS or C# (preferably) is good.Has…
Muzz5
  • 481
  • 3
  • 5
  • 12
15
votes
2 answers

How is a 3d perlin noise function used to generate terrain?

I can wrap my head around using a 2D Perlin noise function to generate the height value but I don't understand why a 3D Perlin noise function would be used. In Notch's blog, he mentioned using a 3D Perlin noise function for the terrain generation on…
Xavier
  • 8,828
  • 13
  • 64
  • 98
14
votes
2 answers

In need of Fractional Brownian Noise (FBM) vs Perlin Noise clarification

I'm researching the various types of noise for terrain generation and I'm a little confused regarding when noise becomes perlin noise and when perlin noise becomes fbm. I'm hoping somebody could clarify anywhere that I'm going wrong. I currently…
user2211776
  • 239
  • 1
  • 2
  • 11
14
votes
4 answers

Realistic 2D terrain map generation

I am looking for some algorithms which allow me to generate a realistic 2D terrain map. By realistic I mean that person will consider such map as a "normal" terrain map, not created artificially. I don't want to create photorealistic map. Just…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
13
votes
5 answers

WebGL - Textured terrain with heightmap

I'm trying to create a 3D terrain using WebGL. I have a jpg with the texture for the terrain, and another jpg with the height values (-1 to 1). I've looked at various wrapper libraries (like SpiderGL and Three.js), but I can't find a sutable…
goocreations
  • 2,938
  • 8
  • 37
  • 59
12
votes
2 answers

Procedural Terrain with ridged fractal noise

I implemented bilinear interpolated white noise in order to procedurally generate terrain. I can obtain this kind of result: I would like to implement ridged fractal noise to get a more realistic terrain like: However I can't find a good tutorial…
JimZer
  • 918
  • 2
  • 9
  • 19
1
2 3
38 39