|
|
From the POV-pi documentation :
The df3 format consists of a 6 byte header of three 16-bit integers
with high order byte first. These three values give the x,y,z size of
the data in pixels (or more appropriately called voxels). This is
followed by x*y*z unsigned integer bytes of data. The data in the
range of 0 to 255 is scaled into a float value in the range 0.0 to
1.0. It remains at 0.0 for all areas beyond the unit cube. The
pattern occupies the unit cube regardless of the dimensions in voxels.
This doesn't specify the ordering of the voxels...
For example, is the following perl fragment correct?
(I am interested primarily in the ordering : which
variable varies quickly, which slowly?)
print pack ( "NNN", $x_size, $y_size, $z_size );
for ( $x = 0; $x < $x_size; $x ++ ) {
for ( $y = 0; $y < $y_size; $y ++ ) {
for ( $z = 0; $z < $z_size; $z ++ ) {
print pack( "C", $u[$x][$y][$z] );
}
}
}
Note: don't use "S" in place of "N" -- "S" produces
system-dependent byte-ordering, as I learned the hard
way....
--
http://www.flash.net/~djconnel/
Post a reply to this message
|
|