GIS: Terrain and model

Started by
4 comments, last by smoke007 14 years, 10 months ago
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
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.
[size="1"]
Thanks, but it looks quite complicated. Isn't there a straightforward way how to create the model directly from contour lines?
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.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

So, I will try to develop algorithm for converting to triangles. I will see...

Thank you all for your help :-)

This topic is closed to new replies.

Advertisement