|
![](/i/fill.gif) |
Eric Fielding wrote:
>
> Does anyone have a program or code fragment (C or Fortran) to convert a
> "raw" Digital Elevation Model to one of the height_field formats that
> POV can use? I have MacDEM, but it only reads the standard USGS DEM
> format or ASCII text PGM files.
>
> It seems a bit inefficient to store a DEM with 16 bits per sample in a
> 24-bit per pixel TARGA or PNG or PPM image, but I guess those formats
> contain the image size in a convenient form.
>
> ++Eric
I've made simple conversion program DEM->16-bit TGA. It's source code
could be found in this news server:
From: Vahur Krouverk <vah### [at] fv aetec ee nospam>
Newsgroups: povray.binaries.utilities
Subject: Re: Problem DEM2POV/DEM2TGA?
Date: Sat, 09 May 1998 19:42:00 +0300
news://news.povray.org/35548758.265F2F5B%40fv.aetec.ee.nospam
Feel free to use it as You like.
Note, that it has defect: it opens input file in text mode, which causes
output data corruption in Windows systems. If You are in *IX world, then
it shouldn't be problem, but on windows there should be instead of:
if ((inf = fopen(filename, "r")) == NULL) {
fprintf(stderr,"Error opening input file %s\n",filename);
exit(1);
}
|----- add this!
this code: v
if ((inf = fopen(filename, "rb")) == NULL) {
fprintf(stderr,"Error opening input file %s\n",filename);
exit(1);
}
Post a reply to this message
|
![](/i/fill.gif) |