Professional Documents
Culture Documents
Figure 1: A temple undergoing destructive modifications. Both models were generated by dual contouring a signed octree whose edges
contain Hermite data. The modified model on the right was computed from the lefthand model in real-time.
Abstract 1 Introduction
This paper describes a new method for contouring a signed grid In the spring of 2001, 17 students in an advanced computer graphics
whose edges are tagged by Hermite data (i.e; exact intersection class set out on a semester-long group project to develop a cutting-
points and normals). This method avoids the need to explicitly iden- edge computer game. One of the primary goals for the game was to
tify and process “features” as required in previous Hermite contour- incorporate technology that allowed real-time modification of the
ing methods. Using a new, numerically stable representation for game geometry. (In gaming terminology, such geometry is referred
quadratic error functions, we develop an octree-based method for to as “destructible”.) The geometric engine for the resulting game
simplifying contours produced by this method. We next extend our was based on implicit modeling with the environment modeled as
contouring method to these simplified octrees. This new method the zero contour of a 3D grid of scalar values. Our choice of this
imposes no constraints on the octree (such as being a restricted oc- representation was guided by the fact that CSG operations are par-
tree) and requires no “crack patching”. We conclude with a simple ticularly simple to implement for implicit models. Although this
test for preserving the topology of the contour during simplifica- game was a relative success, we noted that our implicit approach to
tion. modeling had several disadvantages. During a post-project review,
we identified several problems:
CR Categories: I.3.5 [Computation Geometry and Object Model-
ing]: CSG—Curve, surface, solid and object representations • Due to the use of a uniform grid, we were restricted to rela-
Keywords: implicit functions, contouring, crack prevention, tively small grid sizes. In particular, the final game could only
quadratic error functions, polyhedral simplification process environments defined using grids of size 643 due to
the requirement that the game run in real-time.
∗ e-mail: {jutao,losasso,sschaefe,jwarren}@rice.edu • The resulting environment lacked the sharp edges found in
most polyhedral models. Although we could simulate a small
class of shapes such as rooms and hallways by cleverly ma-
nipulating the sign field, the resulting environment was geo-
metrically simple in comparison to those modeled using BSP
Copyright © 2002 by the Association for Computing Machinery, Inc. trees.
Permission to make digital or hard copies of part or all of this work for personal or
classroom use is granted without fee provided that copies are not made or • The polyhedral meshes produced by contouring often con-
distributed for commercial advantage and that copies bear this notice and the full tained large flat regions tiled by numerous small polygons.
citation on the first page. Copyrights for components of this work owned by
The tiling of these flat regions trivially inflated the number of
others than ACM must be honored. Abstracting with credit is permitted. To copy
otherwise, to republish, to post on servers, or to redistribute to lists, requires prior polygons in our model and often overwhelmed the graphics
specific permission and/or a fee. Request permissions from Permissions Dept, card used for the game.
ACM Inc., fax +1-212-869-0481 or e-mail permissions@acm.org.
© 2002 ACM 1-58113-521-1/02/0007 $5.00
339
In preparation for the next version of the gaming class, the in-
structor and three members of the class (the authors) decided to pur-
sue a yearlong project to rewrite the game engine to address these
deficiencies. In particular, we focused on adapting three pieces of
recently developed modeling technology for our program. Each of
these pieces addresses one of the problems:
340
Figure 3: A sphere contoured using the Marching Cubes method
(left) and the SurfaceNets method (right).
1. For each cube that exhibits a sign change, generate a vertex where the matrix AT A is a symmetric 3 × 3 matrix, AT b is a column
positioned at the minimizer of the quadratic function of equa- vector of length three and bT b is a scalar. The advantage of this ex-
tion 1. pansion is that only the matrices AT A, AT b and bT b need be stored
(10 floats), as opposed to storing the matrices A and b. Further-
2. For each edge that exhibits a sign change, generate a quad more, a minimizing value x̂ for E[x] can be computed by solving
connecting the minimizing vertices of the four cubes contain- the normal equations AT Ax̂ = AT b.
ing the edge. One drawback of this representation is that it is numerically un-
stable. For example, consider computing the value of E[x] in float-
This method is an interesting hybrid of the EMC method and ing point arithmetic when the intersection points and normals used
the SurfaceNets method. It uses the EMC method’s feature ver- in constructing E[x] are sampled from a flat area. For a grid of size
tex rule for positioning all vertices of the contour while using the 2563 (as in figure 1), the magnitude of bT b can be on the order of
SurfaceNets method to determine the connectivity of these vertices. 106 . Since floats are only accurate to six decimal digits, if E[x] is
(Note that the SurfaceNets method uses a completely different rule evaluated at points on the original flat area (where E[x] should be
zero), the resulting value has an error on the order of 1.
methods like the ones above since this grid structure is the basis of our fast One possible solution to this problem is to use double precision
CSG operations. numbers instead of floats in representing AT A, AT b and bT b. Us-
341
ing doubles, the value of E[x] in our flat example now has an error
of 10−6 . Of course, the main drawback of using doubles in place
of floats is that the space require to store a QEF is doubled. For
our application, we found this solution to be problematic since our
program tended to be space bound as opposed to being time bound.
(See the last section for details.)
An alternative representation for QEFs that delivers the accuracy
of doubles while using only floats is based on the QR decomposi-
tion [Golub and Van Loan 1989]. If (A b) is the matrix formed by
appending the column vector b to the matrix A, the idea behind this
decomposition is to compute an orthogonal matrix Q whose product
with (A b) is an upper triangular matrix of the form
x x x x
0 x x x  b̂
0 0 x x 0 r .
= (3)
0 0 0 x 0 0
0 0 0 0 ... ...
... ... ... ...
342
When three or more materials meet inside a single cube, dual
contouring places the minimizing vertex at or near their intersection
point. This positioning allows the outlines of letters and characters
embossed on a surface to be reproduced very accurately. (The right-
hand portion of figure 12 shows a close-up example of this effect.)
Cube-based contouring methods constrain the vertices of the con-
tour to lie on the edges of the 3D grid making this effect difficult to
achieve.
The move to the multi-material case allows for several interest- Figure 7: Closeups of two polygonal approximations to the temple
ing variations on the CSG operations used in the two-material case. computed using the standard (left) and QR (right) representation for
In place of the standard CSG operations, we use a single operation QEFs.
Add that overwrites a portion of the existing model with a new ma-
terial. Subtractive operations such as the spherical cut in the upper
right of figure 5 can be represented as adding a sphere of empty
The only modification that we make to this method is to change
space to the model. Another useful variant of Add is the operation
our internal representation for QEFs to take advantage of the QR
Replace that overwrites only the solid portion of the model. This
decomposition discussed in the previous section. To this end, we
operation can also be used to simulate texturing a portion of the
represent a QEF in terms of 10 floats corresponding to the entries
contour. For example, the lower images in figure 5 show a portion
of the upper triangular matrix of equation 3. Adding two QEFs cor-
of the solid replaced by a blue material and then subsequently cut
responds to merging the rows of their two upper triangular matrices
by a sphere.
to form a single 8 × 4 matrix of the form
x x x x
3 Adaptive dual contouring
0 x x x
0 0 x x
The previous algorithm for dual contouring has the obvious disad-
0
vantage of being formulated for uniform grids. In practice, most of 0 0 x
x x x x
a uniform grid is devoted to storing homogeneous cubes (i.e; cubes
0 x x x
whose vertices all have the same sign). Only a small fraction of the
0 0 x x
cubes are heterogeneous and, thus, intersect the contour. One way
to avoid this waste of space is to replace the uniform grid by an 0 0 0 x
octree. In this section, we describe an adaptive version of dual con-
touring based on simplifying an octree whose leaves contain QEFs. and then performing a sequence of Givens rotations to bring the
This method is essentially an adaptive variant of a uniform simpli- matrix back into upper triangular form of equation 3. Due to the or-
fication method due to [Lindstrom 2000]. Our method has three thogonality of the Givens rotations, the QEF for the merged system
steps: is the sum of QEFs associated with the unmerged systems. Note
that bringing the merged system back into upper triangular form
• Generate a signed octree whose homogeneous leaves are max- is slower (around 150 arithmetic operations) than simply adding
imally collapsed. 10 floats as done in the standard representation. However, the im-
proved stability of the representation leads to better simplifications.
• Construct a QEF for each heterogeneous leaf and simplify the Figure 7 gives a concrete illustration of the advantage of the QR
octree using these QEFs. representation’s stability. The meshes in this figure show two sim-
plifications of the temple from figure 1 to an error of 0.014; the left
• Recursively generate polygons for this simplified octree. mesh was computed using the standard representation for QEFs, the
Note that our method also differs from Lindstrom’s method in that right mesh was computed using the QR representation for QEFs.
we generate polygons from the signed octree instead of collapsing (To give a sense of scale, the temple was defined over a 2563 unit
polygons in an existing mesh. grid.) Due to the numerical error introduced by the instability of the
Generating the signed octree in the first step is relatively straight- standard representation, the mesh on the left contains 78K polygons
forward. For implicit or polygonal models, this octree can be con- while the mesh on the right has 36K polygons.
structed recursively in a top-down manner by spatially partitioning
the models. For signed data on a uniform grid, this octree can be 3.2 Polygon generation for simplified octrees
generated in a bottom-up manner by recursively collapsing homo-
geneous regions. The next two subsections examine the second and Given this simplified octree, our next task is to modify the poly-
third parts of this process in more detail. (Note that the adaptive gon generation phase of dual contouring appropriately. For cube-
method described here works for the multi-material case without based methods, this problem of generating contours from octrees
modification.) has been extensively studied [Bloomenthal 1988; Wilhelms and
Gelder 1992; Livnat et al. 1996; Shekhar et al. 1996; Westermann
et al. 1999; Frisken et al. 2000; Cignoni et al. 2000]. Typically,
3.1 Octree simplification using QEFs these methods restrict the octree to have neighboring leaves that
Our approach to the second step of the adaptive method is to con- differ by at most one level (i.e; “restricted” octrees) and usually per-
struct a QEF associated with each heterogeneous leaf using equa- form some type of crack repair to ensure a closed contour. [Perry
tion 1. Note that the residual associated with the minimizer of this and Frisken 2001] describes a variant of the SurfaceNets algorithm
QEF estimates how well the minimizing vertex approximates the for signed octrees based on enumerating the edges associated with
original geometry [Garland and Heckbert 1998]. Our approach to leaves of the octree. In particular,
simplifying the resulting octree is to form QEFs at interior nodes
of the octree by adding the QEFs associated with the leaves of the • For each edge that exhibits a sign change, generate all trian-
subtree rooted by the node. Those interior nodes whose QEFs have gles that connect the vertices associated with any three distinct
a residual less than a given tolerance are collapsed into leaves. cubes containing the edge.
343
Figure 9: Recursive functions faceProc (black) and edgeProc
(gray) used in enumerating pairs of leaf squares that contain a com-
mon edge.
344
Specifically, given an interior node in the octree whose eight chil-
dren are leaves, we desire a test based on the signs (or indices) at
the corners of these leaves that guarantees that the topological con-
nectivity of the dual contour and its textured regions is preserved
during collapse of the node.
345
Project for their gracious permission to use the scanned version of
Michelangelo’s David.
References
B LOOMENTHAL , J., AND F ERGUSON , K. 1995. Polygonization of non-manifold
implicit surfaces. In Proceedings of SIGGRAPH 95, ACM SIGGRAPH / Addison
Wesley, Los Angeles, California, Computer Graphics Proceedings, Annual Confer-
ence Series, 309–316. ISBN 0-201-84776-0.
Figure 11: Three multi-material quadtrees and their dual contours.
B LOOMENTHAL , J. 1988. Polygonization of implicit surfaces. Computer Aided
Geometric Design 5, 4, 341–356.
B ONNELL , K. S., S CHIKORE , D. R., J OY, K. I., D UCHAINEAU , M., AND H AMANN ,
B. 2000. Constructing material interfaces from data sets with volume-fraction
information. In IEEE Visualization 2000, 367–372. ISBN 0-7803-6478-3.
C IGNONI , P., G ANOVELLI , F., M ONTANI , C., AND S COPIGNO , R. 2000. Recon-
struction of topologically correct and adaptive trilinear isosurfaces. 399–418.
F OLEY, J., VAN DAM , A., F EINER , S., AND H UGHES , J. 1995. Computer Graphics:
Principles and Practice. Addison Wesley.
F RISKEN , S. F., P ERRY, R. N., ROCKWOOD , A. P., AND J ONES , T. R. 2000. Adap-
tively sampled distance fields: A general representation of shape for computer
graphics. In Proceedings of SIGGRAPH 2000, ACM Press / ACM SIGGRAPH
/ Addison Wesley Longman, Computer Graphics Proceedings, Annual Conference
Series, 249–254.
Figure 12: The Chinese cube after unsafe simplification (left) and G ARLAND , M., AND H ECKBERT, P. S. 1998. Simplifying surfaces with color and
safe simplification (right). Note that distinct parts of the character texture using quadric error metrics. In IEEE Visualization ’98, IEEE, 263–270.
have merged during unsafe simplification. G ERSTNER , T., AND PAJAROLA , R. 2000. Topology preserving and controlled topol-
ogy simplifying multiresolution isosurface extraction. In IEEE Visualization 2000,
259–266.
the portion of the contour corresponding to the chosen index is a G IBSON , S. F. F. 1998. Using distance maps for accurate surface reconstruction in
manifold. sampled volumes. In 1998 Volume Visualization Symposium, IEEE, 23–30.
Figure 11 shows two multi-material quadtrees that are candidates G OLUB , G. A., AND VAN L OAN , C. F. 1989. Matrix Computations, second ed. The
for simplification. The left quadtree is rejected since the third check Johns Hopkins University Press.
fails on the bottom edge of the quadtree. The middle quadtree G USKOV, I., AND W OOD , Z. 2001. Topological noise removal. In Graphics Interface
passes all three checks and collapses to the quadtree on the right. 2001, 19–26.
Note that the contour for this collapsed quadtree is a quasi-manifold
KOBBELT, L. P., B OTSCH , M., S CHWANECKE , U., AND S EIDEL , H.-P. 2001.
since the collapsed edge graph for this square is a triangle. Feature-sensitive surface extraction from volume data. In Proceedings of SIG-
Figure 12 shows two simplified versions of the Chinese cube GRAPH 2001, ACM Press / ACM SIGGRAPH, Computer Graphics Proceedings,
from figure 5. The left version has been simplified without any Annual Conference Series, 57–66.
type of topological safety. Note that the disjoint components of the
L INDSTROM , P. 2000. Out-of-core simplification of large polygonal models. In Pro-
Chinese character have fused together. The right version has been ceedings of SIGGRAPH 2000, ACM Press / ACM SIGGRAPH / Addison Wesley
safely simplified using the multi-material test with separate regions Longman, Computer Graphics Proceedings, Annual Conference Series, 259–262.
of the character remaining distinct after simplification.
L IVNAT, Y., S HEN , H.-W., AND J OHNSON , C. R. 1996. A near optimal isosurface
extraction algorithm using the span space. 73–84.
5 Results P ERRY, R. N., AND F RISKEN , S. F. 2001. Kizamu: A system for sculpting digital
characters. In Proceedings of SIGGRAPH 2001, ACM Press / ACM SIGGRAPH,
The current version of our geometric program runs on a consumer- Computer Graphics Proceedings, Annual Conference Series, 47–56.
grade PC equipped with a GeForce 3 video card. The program ROSSIGNAC , J., AND B ORRELL , P. 1993. Multi-resolution 3d approximation for
performs adaptive dual contouring on an indexed octree. The ta- rendering complex scenes. In Modeling in Computer Graphics, 455–465.
ble below shows the number of quads generated by our method for S HEKHAR , R., FAYYAD , E., YAGEL , R., AND C ORNHILL , J. F. 1996. Octree-based
various examples after simplification to an error tolerance of 0.01. decimation of marching cubes surfaces. In IEEE Visualization ’96, IEEE, 335–344.
(All grids have unit spacing.) The time field represents the total
S TANDER , B. T., AND H ART, J. C. 1997. Guaranteeing the topology of an implicit
time to simplify the initial octree (with topological safety) and then surface polygonization for interactive modeling. In Proceedings of SIGGRAPH 97,
generate polygons from the simplified octree. The CSG operations ACM SIGGRAPH / Addison Wesley, Los Angeles, California, Computer Graphics
(spheres of radius 6) in figure 1 took approximately 30 milliseconds Proceedings, Annual Conference Series, 279–286.
to compute.
W ESTERMANN , R., KOBBELT, L., AND E RTL , T. 1999. Real-time exploration of
regular volume data by adaptive reconstruction of isosurfaces. 100–111.
model # quads time (MS) space (MB)
part 643 2578 44 1.3 W ILHELMS , J., AND G ELDER , A. V. 1992. Octrees for faster isosurface generation.
201–227.
Chinese cube 1283 1646 636 32
W OOD , Z. J., D ESBRUN , M., S CHR ÖDER , P., AND B REEN , D. 2000. Semi-regular
temple 2563 39201 3586 156
mesh extraction from volumes. In IEEE Visualization 2000, 275–282.
david 5123 143533 2948 91
Acknowledgements We would like to thank Danny Sorenson for
his suggestion to use the QR decomposition to represent QEFs.
We would also like to thank Marc Levoy and the Michelangelo
346