Sign in to follow this  
smoke007

GIS: Terrain and model

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

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