Previous:Cylindrical   Main Index   Next:Dents



Density_File

The density_file pattern is a 3-D bitmap pattern that occupies a unit cube from location <0,0,0> to <1,1,1>. The data file is a raw binary file format created for POV-Ray called df3 format. The syntax provides for the possibility of implementing other formats in the future. This pattern was originally created for use with halo or media but it may be used anywhere any pattern may be used. The syntax is:

pigment {density_file df3 "filename.df3" [interpolate Type] [PIGMENT_MODIFIERS...] }

where "filename.df3" is a file name of the data file.

As a normal pattern, the syntax is

normal {density_file df3 "filename.df3" [, Bump_Size]
[interpolate Type] [NORMAL_MODIFIERS...]
}

The optional float Bump_Size should follow the file name and any other modifiers follow that.

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.

The interpolate keyword may be specified to add interpolation of the data. The default value of zero specifies no interpolation. A value of one specifies tri-linear interpolation.

See the sample scenes for data file include\spiral.df3,and the scenes which use it: scenes\textures\surfaces\densfile.pov, scenes\interior\media\galaxy.pov for examples.



Previous:Cylindrical   Main Index   Next:Dents