NAME

cxGeoOctreeDefine - define an octree volume object

C SPECIFICATION

#include <cx/Geometry.h>

enum cxGeoSplatType { CX_GEO_SPLAT_POINT, CX_GEO_SPLAT_CONSTANT, CX_GEO_SPLAT_LINEAR, CX_GEO_SPLAT_GAUSSIAN, CX_GEO_SPLAT_TEXTURE };

cxGeo cxGeoOctreeDefine(int nIndices, int *octreeIndex, int numAttributes, float *point, float *voxelSize, float xmin, float ymin, float zmin, float xmax, float ymax, float zmax, float oxmin, float oymin, float ozmin, float oxmax, float oymax, float ozmax, cxGeoSplatType splatType, float splatSize, int radSamples, int aziSamples)

FORTRAN SPECIFICATION

integer CX_GEO_SPLAT_POINT
integer CX_GEO_SPLAT_CONSTANT
integer CX_GEO_SPLAT_LINEAR
integer CX_GEO_SPLAT_GAUSSIAN
integer CX_GEO_SPLAT_TEXTURE

parameter (CX_GEO_SPLAT_POINT = 0) parameter (CX_GEO_SPLAT_CONSTANT = 1) parameter (CX_GEO_SPLAT_LINEAR = 2) parameter (CX_GEO_SPLAT_GAUSSIAN = 3) parameter (CX_GEO_SPLAT_TEXTURE = 4)

integer function cxGeoOctreeDefine(nIndices,octreeIndex, numAttributes, point, voxelSize, xmin, ymin, zmin, xmax, ymax, zmax, oxmin, oymin, ozmin, oxmax, oymax, ozmax, splatType, splatSize, radSamples, aziSamples) integer nIndices, octreeIndex, numAttributes real point(3,*), voxelsize(numAttributes) real xmin, ymin, zmin, xmax, ymax, zmax real oxmin, oymin, ozmin, oxmax, oymax, ozmax integer splatType, radSamples, aziSamples real splatSize

PARAMETERS

nIndices
Number of octree encoding indices.
octreeIndex
The linear encoding of the volume octree.
numAttributes
The number of point and voxelSize attributes.
point
An optional array of XYZ triples containing leaf node locations.
voxelSize
An optional array of leaf node sizes.
xmin
The bounding box x minimum of the volume.
ymin
The bounding box y minimum of the volume.
zmin
The bounding box z minimum of the volume.
xmax
The bounding box x maximum of the volume.
ymax
The bounding box y maximum of the volume.
zmax
The bounding box z maximum of the volume.
oxmin
The bounding box x minimum of the octree.
oymin
The bounding box y minimum of the octree.
ozmin
The bounding box z minimum of the octree.
oxmax
The bounding box x maximum of the octree.
oymax
The bounding box y maximum of the octree.
ozmax
The bounding box z maximum of the octree.
splatType
An enumeration for the type of splat.
splatSize
A scale factor for the splat.
radSamples
The number of radial samples in the splat.
aziSamples
The number of azimuthal samples in the splat.

DESCRIPTION

This function creates a volume object described and rendered as an octree. The rendering algorithm and algorithms to generate the octree description are described in:
Laur, D. and P. Hanrahan. "Hierarchical Splatting: A Progressive Refinement
Algorithm for Volume Rendering." Computer Graphics 25(4): pp. 285-288.

Briefly, each leaf in the octree contains information about the color, transparency, location, and size of the node. A screen-oriented "splat" is drawn for each leaf node, using this specification.

The octree shape is encoded into the linear array octreeIndex, which is organized as follows:

Each entry of the octree is either a leaf node or a branch. Leaf nodes are represented by a non-negative number whose value indexes into the color, transparency, location, and voxel size of the node. Location and voxel size if specified, are passed through point and voxelSize. Use cxGeoColorAdd(3E) and cxGeoTransparencyAdd(3E) to set color and transparency attributes.

If the entry is a negative number, then the absolute value of that entry is the relative offset to the eight child nodes of that branch. For example, the first entry in the octree is a branch node whose value is -1 (its children are 1 index away from the current location).

The special leaf node index of zero inhibits drawing of a leaf node, so the first color, transparency, location, and voxel size attributes will be ignored. The total number of indices in octreeIndex should be nIndices.

The numAttributes argument specifies the number of unique attributes in the point and voxelSize arrays (this number should be less than or equal to the number of leaf nodes). point is an array of coordinate triplets (x,y,z) for the location of each leaf node. It can be NULL, in which case the octree is assumed to be uniform, and the location is determined from the bounding box arguments, xmin, ymin, zmin, xmax, ymax, zmax. voxelSize is an array of floats with one value for each voxel. This is a scaling factor for the polygonal splat which is used for all voxels (this can also be NULL, in which case it is assumed to be unity for all voxels).

The splatType can be of the following types, in increasing complexity:

CX_GEO_SPLAT_POINT
Draw points at every leaf node. Voxel scaling is done in screen space.
CX_GEO_SPLAT_CONSTANT
Draw constant-valued splats. Equivalent to nearest neighbor reconstruction.
CX_GEO_SPLAT_LINEAR
Draw a splat whose transparency falls off linearly with the radius.
CX_GEO_SPLAT_GAUSSIAN
Draw a splat whose transparency falls off roughly as a Gaussian distribution.
CX_GEO_SPLAT_TEXTURE
Draw a textured splat with /usr/explorer/data/image/reconstruction.bw.

splatSize is the size of the splat in world space, unless the splat is of type CX_GEO_SPLAT_POINT in which case it is in pixels. Two arguments govern the tessellation of the splat: radSamples and aziSamples. radSamples is the number of radial samples in the reconstruction function. It should be 1 for CX_GEO_SPLAT_LINEAR and greater than 1 for CX_GEO_SPLAT_GAUSSIAN. The ideal value for CX_GEO_SPLAT_TEXTURE is 1.6. aziSamples is the number of azimuthal samples, which should be 3 or greater and only affects linear or Gaussian reconstruction).

Note that both the bounding box of the volume and the bounding box of the octree are specified independently. This is so that any padding of the data samples, e.g. to a power of two, can be accounted for.

SEE ALSO

cxGeoColorAdd(3E), cxGeoTransparencyAdd(3E)
Last modified: May 25 14:05 1999
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1999