PDA

View Full Version : How to read data from digital terrain model files in VC++ application for OpenGL



jitendrapatil
02-21-2013, 09:01 PM
I want to create an openGL application for manipulating Digital Terrain Model, I got some DTM files but i cant understand the structure of file how to use that data for creation of coordinates in OpenGL. Please help me to understand to know the format of DTM files how i get the proper data to draw maps or different shape from DTM files.

Thank you in Advance.

carsten neumann
02-25-2013, 12:45 PM
Hmm, kinda difficult if you don't know the structure of the data files...
Normally these are grayscale images where each pixel encodes the height at a regular grid cell. For some formats the file header contains information about the range (e.g. black pixel is 100m below reference elevation, white pixel is 10000m above reference elevation - just as an example, I'm making up the numbers) as well as the location and size of the grid.
You can take a look at the forum posting guidelines (http://www.opengl.org/discussion_boards/showthread.php/176139-Forum-Posting-Guidelines) for suggestions how to ask questions that are likely to produce more helpful answers ;)

tonyo_au
02-25-2013, 07:44 PM
Normally these are grayscale images where each pixel encodes the height at a regular grid cell.
Strictly that is a DEM or digital elevation model which is a subset of DTM's. DTM is a set of 3D data points which may or may not have been triagulated. DEM are quite easy to process in OpenGL as the vertex shader can compute the x,y from the grid cell size and origin, DTM's may require processing through a trianglualtion algorithm before you can render them

jitendrapatil
03-20-2013, 11:56 PM
thanks for reply, i create application that open dem files in opengl