POV-Ray : Newsgroups : povray.windows : Height Field Files : Re: Height Field Files Server Time
28 Jul 2024 18:23:00 EDT (-0400)
  Re: Height Field Files  
From: PoD
Date: 26 Apr 1998 14:25:21
Message: <35437C11.2559@merlin.net.au>
David Vincent-Jones wrote:
> 
> I am generating data for a height field and would like to directly create
> the holding file. I will be working with 16 bit data in Win95.
> Can somebody steer me to the file layout for a .sys or other format that is
> not too complex to create without a paint program.

The simplest format to create is probably TGA, it's supported in every
version of POV-Ray as well.  All you need is an 18 byte header as
follows

2 bytes both zeros
1 byte value 2 (this means uncompressed true colour)
5 bytes all zeros ( colourmap specifier, you won't have one hence all
zeros)
16 bit integer, value 0 (x origin)
16 bit integer, value 0 (y origin)
16 bit integer, width of image in pixels
16 bit integer, height of image in pixels
1 byte value 24 (pixel size)
1 byte value = 32 ( top down image )

then just put your data in using the following format for each pixel
0,low byte,high byte

Hope this helps (hope I got it right as well :) )
PoD.


Post a reply to this message

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