|
![](/i/fill.gif) |
fidel viegas wrote:
>
>ingo wrote:
>> in news:3E1### [at] nodomain com fidel viegas wrote:
>>
>>
>>>Is there a good tutorial on how to
>>>process df3 files?
>>
>>
>> No, but there is a tga2df3 convertor at http://www.users.on.net/pod/df3/
>
>Thanks for the link. I've looked into it already.
>
>>>And what about its format?
>> See 6.7.11.11 Density_File
>
>I also read this on the documentation. Now I came across another program
>called df3maker and it takes text version of the data and outputs the
>binary version. I know how to create the binary file, but I have a doubt
>regarding its format. I found the data below at the df3maker web site:
>
>4,3,5
>0,50,50,0
>50,100,100,50
>0,50,50,0
>10,100,100,10
>100,200,200,100
>10,100,100,10
>50,150,150,50
>150,255,255,150
>50,150,150,50
>10,100,100,10
>100,200,200,100
>10,100,100,10
>0,50,50,0
>50,100,100,50
>0,50,50,0
>
>Ok, I understand the 4, 3 and 5, which are the dimensions of the cube in
>x, y and z respectively. My question is how do we come up with the data
>values? In the docs it had x*y*z, does it mean that each cell is the
>result of multiplying x, y and z? For instance the second value 50, is
>it the result of this multiplication?
......
I would guess (without knowing anything about
the text/file format for df3maker) that the
data in the text above is organized like this:
#declare Densities =
array [5][3][4] {
{
{ 0, 50, 50, 0 },
{ 50, 100, 100, 50 },
{ 0, 50, 50, 0 }
},
{
{ 10, 100, 100, 10 },
{ 100, 200, 200, 100 },
{ 10, 100, 100, 10 }
},
{
{ 50, 150, 150, 50 },
{ 150, 255, 255, 150 },
{ 50, 150, 150, 50 }
},
{
{ 10, 100, 100, 10 },
{ 100, 200, 200, 100 },
{ 10, 100, 100, 10 }
},
{
{ 0, 50, 50, 0 },
{ 50, 100, 100, 50 },
{ 0, 50, 50, 0 }
}
}
(I use POV syntax, because we all
know it.)
This would mean that the density
within the "cell" with coordinates
x = 0, y = 1 and z = 2 is:
Densities[2][1][0] = 150
(The value 4*3*5= 60 would be the
number of "cells" in the cube, and
therefore the number of densities
in your list above.)
But remember that I'm just guessing.
>Another question is regarding the tga2df3 converter. How does the 2D
>grid of pixels found in a tga picture translate to a 3D grid?
This program operates on several TGA-
pictures to make one single density
file.
Each TGA-picture represents a cut(?)
through the object. And the light-
ness/darkness in the pictures repre-
sents the denisity in the corre-
sponding region (or "cell").
So the Width and Height dimensions
(number of pixels in each direction)
of the TGA-pictures represents the
width and height of the cube con-
taining the object. The number of
TGA-pictures represents the depth of
the cube.
Each picture represents a layer of
"cells". The number of cells that
each represents is Width*Height.
And the total number of "cells" that
all the TGA pictures represents is
Width*Height*NrOfPictures.
So if you were to produce a density
file for a brain, you would need many
pictures, each of a different cut of
a real brain.
Tor Olav
Post a reply to this message
|
![](/i/fill.gif) |