Sign in to follow this  
nik600

draw 3D mountain from isohypse coordinates

Recommended Posts

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


Link to post
Share on other sites
nik600    122
hi

thank's for your reply

the format of my data are like this:

Quote:

print iso 2
127,20
124,20
40,69
40,68
203,60
101,60
80,116
211,80
80,89
82,80
100,138
208,100
100,61
80,100
120,139
186,120
120,50
81,120
140,139
140,54
160,139
160,57
180,129
56,180
180,60
54,180
200,108
105,200
200,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 this post


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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this