# draw 3D mountain from isohypse coordinates

## Recommended Posts

nik600    122
hi everyone is it possible to draw a 3D mountain if i have the coordinates of the isohypse?

##### Share on other sites
Squirm    481
For those who didnt understand the question, an iso-thingummy means a bunch of contour lines. The answer, then, is yes. If your next question is how, then that depends on the format of your data.

The simplest approach would be to make a flat terrain mesh, and then check which contour each vertex is in, and use that to set the height of the vertex. There are more precise things you could do, but that would get you off to a flying start and be g-card friendly.

##### Share on other sites
nik600    122
hi

the format of my data are like this:

Quote:
 print iso 2127,20124,2040,6940,68203,60101,6080,116211,8080,8982,80100,138208,100100,6180,100120,139186,120120,5081,120140,139140,54160,139160,57180,12956,180180,6054,180200,108105,200200,60

for each isohypse i have got x and y coordinates (z, the altitude is =constant*number of isohypse)

can i do what you suggest me using c++ and OpenGL?

where can find I some example about that?

Quote:
 to make a flat terrain mesh, and then check which contour each vertex is in, and use that to set the height of the vertex

##### Share on other sites
Squirm    481
I don't think I can find you an example... make a 2D array of points the size of your map, and populate each one with the height of the isohypse going through it. Then go back over it and interpolate between nearby points to fill in the gaps. Then call the result a heightmap and proceed as normal.

The tricky bit will be deciding which points to interpolate between, and I don't know the best answer to that. I can think of several possible approaches, but I've never tried any your best bet is probably to experiment.

[edit - just realised you don't have a complete isohypse - have you got some sort of sequence of lines instead? In that case the same applies, but you also need a line drawing algorithm (aka bresenham) to get from one point to the next.]