How to read data from digital terrain model files in VC++ application for OpenGL

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.

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 for suggestions how to ask questions that are likely to produce more helpful answers :wink:

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

thanks for reply, i create application that open dem files in opengl