Generating landscapes. How to set real values?

Hello! I’m creating a program in JavaScript which will generate a landscape. It would be great to use real z-coordinate values. The idea is to use some function and it’ll return me the altitude of a certain point. Well, I got a question. Where can I find this function? How can I find the altitude of certain coordinates?

2 Likes

I’m afraid the Z axis is either very hard to use or does not exist. However you could zoom in and out of images to make a Z axis. Besides this i dont really know much about 3d graphics. Sorry if i couldnt help

Hi @Tanya,

Would you mind to elaborate on your description ?

These points in particular:

  • Are you generating a 2D landscape (like a painting) or a 3D terrain ?
  • What is the structure of this landscape/terrain (mesh, nurbs, pixels, …) ?
  • What do you mean by “real” coordinates ? (altitude of a real life mountain or Z-coordinates of your generated terrain/landscape)
  1. 3D terrain
  2. It looks like a grid
  3. Real altitude above sea level
    Now I have a program which can generate some random landscape. But I want to create real landscape that already exsits on the planet.
2 Likes

you are looking for a data base that contains the height information for any given point on the earth.

  • First we have to look at the resolution. Do you think of your continent or your home town?

  • Second the amount of data is just huge.

  • Third: You cannot download this. You better access data like this online. Which is always a hassle since it’s complicate language.

Read this:

https://wiki.openstreetmap.org/wiki/Relief_maps

I think what you are trying to achieve is similar to a DEM (Digital Elevation Model).

DEM are often made from 2 types of data:

  • satellite data (imagery or/and height)
  • LiDAR data (point clouds)

The latter is usually more dense and detailed (3D representation of trees, cars, houses, …) than the former that just gives the elevation.


(example of a LiDAR point cloud, source)

In your case you would need to feed your grid with either one of these two (the former preferably) but you should note that:

  • elevation data is rather difficult to get a hold of
  • if often comes at a price (you have to buy it)
  • the variety of formats can sometimes be baffling

That being said you can find free alternatives here (satellite data) or here (LiDAR data).

Another approach would consist in approximating the height of a terrain by mapping the brightness of the pixels of a black and white satellite photograph against a range of arbitrary values.


(satellite image example)

Unfortunately this is very likely to lead to uneven and erratic outputs.

4 Likes

Good source to generate grayscalr maps is

https://tangrams.github.io/heightmapper/