Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

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

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2013
    Posts
    9

    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.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    788
    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

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    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

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2013
    Posts
    9
    thanks for reply, i create application that open dem files in opengl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •