
After filling Blist table, for the set membership
classification a label is attached to each voxel and pass to
the successive primitive in the Blist. When the label
matches the primitive’s name, the voxel is classified against
the primitive. If the result of this classification matches the
primitive’s sign, the name on the primitive’s stamp is put on
the label, if not zero, name is put on the label of the voxel.
At the end of this process, if the labe l on the voxel matches
the IN’s name, the voxel is inside the volume scene tree
otherwise, it is out. In this representation, each voxel has a
classification status with respect to all primitives and we
can use the color of a primitive in its intersection with its
active zone [11]. If the voxel lie in several primitives that
overlap, in this case the result will be order dep endent.
III. VOXELIZATION ALGORITHM
Voxelization is the process of generating volume dataset
from a geometric model. Conceptually, voxelization is a set
membership classification problem for all voxels in a
volume against the given 3D model. In addition, from the
view of the process, voxelization is a 3D scan conversion
process.
Z
X
Y
Vol um e sp a ce
One slice
A cubic volume space is first defined over the CSG model.
The algorithm proceeds slice by slice in a front-to-back
order by moving the Z-plane, a plane parallel to the
projection plane, along the viewing direction to generate
slices for all primitives (Figure 2). For each slice, the
algorithm defines the viewing volume of the system as a
thin space between two adjacent Z-planes inside the volume
boundary, and then renders each primitive within this
viewing volume. When the algorithm moves from Z-plane
to Z-plane, slices of the primitives are displayed and
composited onto the frame buffer in a front-to-back order.
Using proper color-coding of the primitives, the algorithm
can directly generate slices of the point classification
indices in the frame buffer. These classification indices can
then be mapped, by the PCM, to form a binary volume of
the CSG model. The distance between adjacent Z-planes
determines the resolution of the volume in the Z direction.
The reso lutions in the X and Y d irections are determined by
the size of the display window.
If the CSG tree has n primitives n distinct colors are
assigned to the different primitives so that the color co de of
the jth primitive is a binary number, with the jth bit set to 1
and all other bits set to 0. For a sp atial point P, the color of
P with respect to the jth primitive, C
j
(P), is defined as the
color of the jth primitive if P is inside the primitive, and o
otherwise. Now, if we combine C
1
(p), C
2
(P),…C
n
(P) using
a logical operation OR or XOR, the result, C(P), is exactly
classification index of point P. Thus, for each Z-plane,
algorithm generates a slice for each primitive, and then
composites the slices from the primitives into one single
slice of classification indices in the frame buffer using
appropriate frame buffer pixel functions. This composition
process is carried out as follows:
For a primitive defined by its surface boundaries, since only
the boundary surfaces are drawn, we need to have a way to
determine the interior points. The idea is similar to the
voxelization algorithm described in [7], and is based on the
principle that when a ray is shot from a pixel towards the jth
primitive in the viewing direction, it has to enter the
primitive object first (jth color bit becoming 1) and stay
there (keeping the jth bit ) until it exits the object (changing
the jth bit to 0). This can be done by drawing the boundary
surfaces of each primitive with a logical XOR operation
(Figure 3). When a slice is complete, the frame buffer will
not be cleared, i.e. the frame buffer content of the slice will
be used for blending operations with subsequent slices. This
way, the XOR operation will automatically set the jth color
bit to 1 for all interior points, and 0 for all outside points.
Since the pixel colors on the slice generated by the jth
primitive has 0’s at all bit positions except the jth, the XOR
operation for the jth primitive will have no effect to the
classifications of other primitives.
One the classification indices are generated in the frame
buffer for each slice, the Point Classification Map can be
applied to the frame buffer image to generate the final CSG
classifications.
P Bl[p].name BL[p].sign BL[p].Primitive
Reference
Bl[p].
stamp
1 0 + A 1
2 0 + B 1
3 0 - C 2
4 1 + D 2
5 0 - E 1
Figure 2. Volume space slicing
相关文档
评论