POV-Ray : Newsgroups : povray.off-topic : Need heightfield converter Server Time
29 Jul 2024 16:31:08 EDT (-0400)
  Need heightfield converter (Message 1 to 2 of 2)  
From: posfan12
Subject: Need heightfield converter
Date: 12 Sep 2011 17:45:00
Message: <web.4e6e7c80583dda9564bf21560@news.povray.org>
If anyone has some spare moments it would be great if you could create a program
to convert TGA or DEM heightfields to LDRaw triangles. The current converters
only convert heightfields to stacks of bricks instead of triangles directly,
unfortunately, and this is not what I need. Information on the specifications
for the LDraw file format can be found at LDraw.org.

This is for a POV-Ray project I am working on. Thanks!


Mike


Post a reply to this message

From: Le Forgeron
Subject: Re: Need heightfield converter
Date: 13 Sep 2011 07:53:28
Message: <4e6f4438$1@news.povray.org>
Le 12/09/2011 23:41, posfan12 a écrit :
> If anyone has some spare moments it would be great if you could create a program
> to convert TGA or DEM heightfields to LDRaw triangles. The current converters
> only convert heightfields to stacks of bricks instead of triangles directly,
> unfortunately, and this is not what I need. Information on the specifications
> for the LDraw file format can be found at LDraw.org.
> 
> This is for a POV-Ray project I am working on. Thanks!
> 
> 
> Mike
> 

Please notice: using triangles to make heightfield means either:
 1. You choose a bias when converting square ABCD to use ABD+ BCD or
ABC+ACD. This has a visible effect (one dominant diagonal)
 2. You choose to use the "center" Q of the square ABCD as the third
point of the four triangles (ABQ, BCQ, CDQ, DAQ). vertical position of Q
is arbitraty (you can choose classic average, min, max, weighted
average, harmonic average,... or even more complex subsampling like
smoother transition taking into account the neighbourg points and further)

Also, TGA allow for raw and compressed format (and there is two versions
of TGA, distinction should be based on string at the end of the file,
the second version adding meta data to the format), and some even have a
palette (color encoding can go from 1 to 24 +8 bits... even if povray
use red+green 8 bits)

Using a (open source) library for reading TGA is recommended.



-- 
Software is like dirt - it costs time and money to change it and move it
around.

Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.


Post a reply to this message

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