|
|
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
|
|
|
|
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
|
|