• Advertisement
Sign in to follow this  

GIS: Terrain and model

This topic is 3191 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, I have question about developing GIS application with DirectX (please, be patient with me because I'm beginer with DirectX). I have file with contour lines (set of polylines) of some area and orthophoto map bitmap. So I need to create model from contour lines and use bitmap as texture. My question is: how to create model from contour lines? Probably I need transform it to triangle list? Could you advice me how to do it? Thanks, Smoke007

Share this post


Link to post
Share on other sites
Advertisement
The simplest way I can think of would be to use a vector graphics renderer to render each contour area (coloured based on height, ordered from lowest to highest) into an image. This image could then be used as a heightmap from which you could create a model in the usual way.

Share this post


Link to post
Share on other sites
Thanks, but it looks quite complicated. Isn't there a straightforward way how to create the model directly from contour lines?

Share this post


Link to post
Share on other sites
The most straightforward way would probably be to create the 3D model with an external application such as this one, then load it normally. Depending on your specific needs and budget this may not be feasible though.

Share this post


Link to post
Share on other sites
Quote:
Original post by smoke007
Isn't there a straightforward way how to create the model directly from contour lines?
Nope, not with Direct3D. The API itself only really understand triangles for the sort of rendering you're after; you can technically render lines but they'll all be single-pixel thickness and it can't fill in the gaps between lines (e.g. some sort of 'surface fill' feature).

Ultimately you have two choices -

1. Write your own algorithm that can convert your source data into triangles that D3D can handle.

2. Find a tool, or modify you're existing toolset, such that you can provide your D3D code with a pre-triangulated mesh.


If you literally only have a set of polylines and no adjacency/context for any given polyline I would imagine #1 will be non-trivial. If, however you know some sort of adjacency (e.g. which polyline represents the next highest contour)then creating a triangle strip for each contour could be quite straight forward.


hth
Jack

Share this post


Link to post
Share on other sites
So, I will try to develop algorithm for converting to triangles. I will see...

Thank you all for your help :-)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement