POV-Ray : Newsgroups : povray.binaries.images : Problem with ASCII matrix read into a mesh2 : Problem with ASCII matrix read into a mesh2 Server Time
9 Aug 2024 01:20:21 EDT (-0400)
  Problem with ASCII matrix read into a mesh2  
From: Jörg 'Yadgar' Bleimann
Date: 2 Apr 2005 06:43:48
Message: <424e8574@news.povray.org>
High!

Another step towards Khyberspace... but at the moment, I'm once again 
hampered by obviously misunderstood technology!

About one year ago, by a posting of Christoph Hormann's latest 
achievements in Earth modeling I was informed about the newly published 
data files of the Shuttle Radar Topography Missions (SRTM), showing the 


At ftp://ftp.glcf.umiacs.umd.edu/glcf/SRTM/Degree_Tiles the single 
1-degree tiles are downloadable for free - in the format of 1200 x 1200 
GeoTIFFs. Unfortunately, although they look very much like 16-bit 
heightfield bitmaps for PoV-Ray, their height scale definition is 
completely different, so that PoV-Ray cannot interprete them in a 
sensible way.

As I did not (yet) found any understandable definition of the GeoTIFF 
standard, I had to content myself with converting them into ASCII 
matrizes with a vertical resolution of 1 metre.

The program I used for this is 3DEM, available at 
http://www.visualizationsoftware.com/3dem.html (according to all I know, 
  there is no Linux version of it!). The converted GeoTIFFs then are 
simple tapeworms of 1,440,000 six-digit float values in clear text, 
separated by blanks, without any CRs and LFs.

As PoV-Ray I/O directives accept only ASCII files with commas as 
delimiters, I had to replace those blanks by commas using the "replace" 
utility of Linux, which worked perfectly.

Then, after some problems with the standard mesh object, Jerome M. 
Berger (thank you, Jerome!) suggested me to use mesh2 instead, I 
rendered a first test version of a spherical mesh2 of GeoTIFF tile 
N34E068 (the geographically inclined among us are inviting to look it up 
  in their favourite atlas ;-)).

But the result was weird, obviously the float values in the ASCII matrix 
are arranged in a different way than the pixels in the GEO-TIFF file.

Attached are the mesh2 rendering and an 2D map generated with 3DEM 
showing how the terrain should look instead.

For better comparability of the land features, I placed a waterline at 
2500 metres elevation in both images.

The code is available on p.b.s-f

See you in Khyberspace!

Yadgar


Post a reply to this message


Attachments:
Download 'iotest-n.png' (67 KB) Download 'n34e068.jpg' (38 KB)

Preview of image 'iotest-n.png'
iotest-n.png

Preview of image 'n34e068.jpg'
n34e068.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.