Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set...

9
The Visual Computer manuscript No. (will be inserted by the editor) Rui Wang · Kun Zhou · John Snyder · Xinguo Liu · Hujun Bao · Qunsheng Peng · Baining Guo Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented as a triangle mesh by a bounding set of spheres having min- imal summed volume outside the object. We show how outside volume for a single sphere can be computed us- ing a simple integration over the object’s triangles. We then minimize the total outside volume over all spheres in the set using a variant of iterative Lloyd clustering which splits the mesh points into sets and bounds each with an outside volume-minimizing sphere. The resulting sphere sets are tighter than those of previous methods. In experiments comparing against a state-of-the-art alter- native (adaptive medial axis), our method often requires half or fewer as many spheres to obtain the same error, under a variety of error metrics including total outside volume, shadowing fidelity, and proximity measurement. 1 Introduction Object approximation using sets of simple primitives plays an important role in many time-critical applications in computer graphics, such as collision, hit, and proxim- ity detection, view-frustum and occlusion culling, visi- bility and ray intersection queries, and shadowing. Many different geometric primitives have been used including spheres [3, 7, 15, 19], axis-aligned bounding boxes (AABBs) [2], oriented bounding boxes (OBBs) [5,11], and discrete oriented polytopes (k-DOPs) [10]. Typically, a trade-off exists between the primitive’s simplicity and its fitting Rui Wang · Xinguo Liu · Hujun Bao · Qunsheng Peng State Key Lab of CAD&CG, Zhejiang University E-mail: {rwang,xgliu,bao,peng}@cad.zju.edu.cn Kun Zhou · Baining Guo Microsoft Research Asia E-mail: {kunzhou,bainguo}@microsoft.com John Snyder Microsoft Research E-mail: [email protected] This work was done while Rui Wang was an intern at Mi- crosoft Research Asia. (a) original (b) clusters (c) outside vol. (d) total vol. approx. approx. Fig. 1 Solid approximation (2D). Our approximation (c), which minimizes outside volume, is more effective than meth- ods (d) minimizing total volume of the bounding elements (blue and red circles). flexibility. A sphere set is probably the simplest represen- tation to update for dynamic geometry and to perform collision-related queries on, and so has found widespread use in applications. Our goal is to bound an object as tightly as possi- ble using a user-specified number of spheres, denoted n s . Previous methods have involved arbitrary decisions and fitting metrics not directly tied to bounding tightness, and have been too local/greedy in their fitting approach. Our solution introduces two contributions: a new metric that more directly measures tightness of fit, and a global, variational method that directly minimizes this metric. Our novel fit function is based on the volume be- tween the sphere set and the original object, called the outside volume (Figure 1c). In particular, our notion of error ignores overlaps in the sphere set as long as they occur in the object’s interior; only sphere volume that “sticks out” of the object is penalized. Neglecting inte- rior overlap provides much-needed flexibility and satisfies our intuition that for many applications, including those related to collision detection and (opaque) visibility, in- terior overlap is irrelevant. To find the sphere centers and radii, we apply a vari- ant of the variational approach in [4] using spheres as the fit primitive and outside volume as the fit function. The method converges to an approximation minimizing out- side volume. For a given n s , we demonstrate that our sphere sets are much tighter than those produced by

Transcript of Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set...

Page 1: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

The Visual Computer manuscript No.(will be inserted by the editor)

Rui Wang · Kun Zhou · John Snyder · Xinguo Liu · Hujun Bao ·

Qunsheng Peng · Baining Guo

Variational Sphere Set Approximation for Solid Objects

Abstract We approximate a solid object represented asa triangle mesh by a bounding set of spheres having min-imal summed volume outside the object. We show howoutside volume for a single sphere can be computed us-ing a simple integration over the object’s triangles. Wethen minimize the total outside volume over all spheresin the set using a variant of iterative Lloyd clusteringwhich splits the mesh points into sets and bounds eachwith an outside volume-minimizing sphere. The resultingsphere sets are tighter than those of previous methods. Inexperiments comparing against a state-of-the-art alter-native (adaptive medial axis), our method often requireshalf or fewer as many spheres to obtain the same error,under a variety of error metrics including total outsidevolume, shadowing fidelity, and proximity measurement.

1 Introduction

Object approximation using sets of simple primitives playsan important role in many time-critical applications incomputer graphics, such as collision, hit, and proxim-ity detection, view-frustum and occlusion culling, visi-bility and ray intersection queries, and shadowing. Manydifferent geometric primitives have been used includingspheres [3,7,15,19], axis-aligned bounding boxes (AABBs)[2], oriented bounding boxes (OBBs) [5,11], and discreteoriented polytopes (k-DOPs) [10]. Typically, a trade-offexists between the primitive’s simplicity and its fitting

Rui Wang⋆ · Xinguo Liu · Hujun Bao · Qunsheng PengState Key Lab of CAD&CG, Zhejiang UniversityE-mail: rwang,xgliu,bao,[email protected]

Kun Zhou · Baining GuoMicrosoft Research AsiaE-mail: kunzhou,[email protected]

John SnyderMicrosoft ResearchE-mail: [email protected]⋆This work was done while Rui Wang was an intern at Mi-crosoft Research Asia.

(a) original (b) clusters (c) outside vol. (d) total vol.approx. approx.

Fig. 1 Solid approximation (2D). Our approximation (c),which minimizes outside volume, is more effective than meth-ods (d) minimizing total volume of the bounding elements(blue and red circles).

flexibility. A sphere set is probably the simplest represen-tation to update for dynamic geometry and to performcollision-related queries on, and so has found widespreaduse in applications.

Our goal is to bound an object as tightly as possi-ble using a user-specified number of spheres, denoted ns.Previous methods have involved arbitrary decisions andfitting metrics not directly tied to bounding tightness,and have been too local/greedy in their fitting approach.Our solution introduces two contributions: a new metricthat more directly measures tightness of fit, and a global,variational method that directly minimizes this metric.

Our novel fit function is based on the volume be-tween the sphere set and the original object, called theoutside volume (Figure 1c). In particular, our notion oferror ignores overlaps in the sphere set as long as theyoccur in the object’s interior; only sphere volume that“sticks out” of the object is penalized. Neglecting inte-rior overlap provides much-needed flexibility and satisfiesour intuition that for many applications, including thoserelated to collision detection and (opaque) visibility, in-terior overlap is irrelevant.

To find the sphere centers and radii, we apply a vari-ant of the variational approach in [4] using spheres as thefit primitive and outside volume as the fit function. Themethod converges to an approximation minimizing out-side volume. For a given ns, we demonstrate that oursphere sets are much tighter than those produced by

Page 2: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

2 Rui Wang et al.

other methods, and produce better results in a varietyof applications.

2 Related Work

Sphere set approximation can be computed by sub-dividing an object into an octree and placing spheres ateach non-vacant leaf node [6,12]. The arbitrary subdivi-sion grid wastes many spheres.

Quinlan [15] uses top-down recursive splitting (RS).It first covers the surface with uniformly-sized spheres,splits the resulting sphere set using the longest axis of itsbounding box, and then recursively visits the two childlists. RS is used for constructing sphere-trees for visi-bility culling and level-of-detail rendering [18] and forcollision detection on deformable models [9]. An alterna-tive is to merge similar spheres in a bottom-up fashion[16,21]. Splitting or merging is done greedily and thussuboptimally at each stage. More fundamentally though,the basic strategy attempts to minimize total boundingvolume rather than outside volume (see Figure 1).

Methods based on the medial axis [7,1] build a Voronoidiagram and center spheres at its vertices. The AdaptiveMedial Axis Approximation (AMAA) [3] extends thisidea using greedy optimization to merge pairs of neigh-boring spheres. The approach is superior to other pro-posed methods, but still involves many greedy decisionsand is not directly tied to outside volume.

Variational approximation alternates two phases, par-titioning based on Lloyd clustering [13] and fitting, in or-der to find an optimal, piecewise-linear approximation ofthe input geometry [4]. Further work [24] extends the ap-proximating primitives from planar elements to spheresand cylinders. Our method builds on this work but usesan entirely different metric (outside volume rather thanintegrated surface distance) appropriate for solid objectqueries such as collision and visibility rather than sur-face simplification. As is true for nonlinear optimizationin general, increased searching and better heuristics canlocate better solutions but finding the global minimumcan not be guaranteed.

3 Sphere Set Approximation

Surface Approximation Approximation theory dealswith the problem of approximating complicated mathe-matical objects with simpler ones. In [4], approximationerror is defined as the distance between the original sur-face X and the approximation Y , defined by

Lp(X,Y ) = (1

|X|

∫∫

x∈X

‖d(x, Y )‖p dx)1

p (1)

d(x, Y ) = infy∈Y

‖x − y‖

where ‖.‖ is Euclidean distance and |.| is surface area.

(b) SOV

(a) outside volume (c) SOTV

Fig. 2 Outside volume, SOV, and SOTV. (a) The green re-gion is the outside volume. (b) A single sphere is divided bythe object’s triangles into two parts: inside (gray) and out-side volume or SOV (green). (c) One triangle is highlighted(brown) to show its corresponding SOTV. SOV is computedvia a sum over SOTVs.

Solid Approximation The above definition is appro-priate for surfaces not solids. On the other hand, [3,7]present a metric suitable for solids that measures dis-tance to the sphere surface along the polygon normal di-rection, over a set of sample points on the original surfaceX. Because the method is based on point samples andprojects distances onto discrete polygon normals, it caneasily miss or underweight regions of large protrusion. Italso neglects concavities (see Figure 5). We instead ap-ply a volumetric version of (1) which measures volumeoutside the object but inside an approximating sphere(Figure 2ab).

More precisely, for a single sphere S the error metric,called sphere outside volume (SOV), is defined as

E(X,S) =

∫∫∫

y∈S

d(X, y) dy (2)

d(X, y) =

0 y ∈ X1 y /∈ X

where X is the original object and d(X, y) returns whethera point y is outside X. The global error metric for theentire sphere set is defined by summing E(X,Si) overall spheres in the set Si. Si is defined by center oi andradius ri.

Unlike Hausdorff error, this definition is one-sided:only volume in the sphere set outside the original meshcounts. This is reasonable since we are computing a bound-ing approximation through which no part of the originalmesh can protrude. Another issue is that our definitionovercounts volume from Si which overlap outside X. Ne-glecting this typically small overlap makes the computa-tion tractable because each Si’s SOV can be computedindependently without a set union operation.

4 Computing Outside Volume

A simple method to compute (2) is to discretize thesphere set volume into a regular grid and count the num-

Page 3: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

Variational Sphere Set Approximation for Solid Objects 3

(a) 3 vert. in (b) 3 vert. out (c) 2 vert. out (d) 1 vert. out

(a) (b)

(c) (d)

Fig. 3 SOTV computation. Four cases (a-d) of the trian-gle/sphere relation, based on how many triangle vertices areinside the sphere, are shown in the top row. The triangleis drawn in red and the darker green region represents itsSOTV. The bottom row shows how the SOTV is computedin each case.

ber of grid cells outside the object. Too many grid cellsare necessary to compute outside volume accurately. Weinstead apply an analytic method to compute the vol-ume by directly integrating it triangle by triangle. For asphere, (2) can be represented as

E(X,S) = V (T, S) (3)

where T is the triangle set representing the object X, andV is the volume outside T but inside the sphere S. Theoutside volume of the entire sphere set approximationthen is:

E(X,Si) =

ns∑

i=1

V (T, Si). (4)

If a triangle t ∈ T is entirely or partly inside thesphere S, then volume exists between the sphere shelland the triangle, denoted V (t, S) and named sphere-outside-triangle volume (SOTV) (Figure 2c). The totalSOV is accumulated by adding or subtracting these SOTVsover all triangles t ∈ T in the solid object’s mesh.

4.1 Computing SOTV

Figure 3 classifies four possible relations between a sphereS = (o, r) and a triangle t ∈ T . Cases (a) and (b) aresimple while (c) and (d) are somewhat more complicated.

For case (a), SOTV is given by

V (t, S) = Vstri(t, S) − Vtet(t, o) =1

3(r3 Ω − D h)

where Vstri(t, S) is the volume bounded by the spheri-cal triangle formed by projecting the vertices of trianglet onto the sphere S, and Vtet(t, c) is the volume of thetetrahedron formed by the sphere center o and the three

(a) (b) (c)

Fig. 4 Swing volume computation. (a) swing volume inte-gral, (b) integral slice: S(x), (c) slice decomposition

vertices of the triangle t. Ω is the solid angle of the tri-angle on the sphere, D is the area of triangle t, h is theheight of t’s plane above o, and r is the sphere radius.For case (b), the volume is

V (t, S) = π h2 (r − h

3).

For case (c), we find the arc representing the inter-section of the triangle and sphere, and the two points,p0 and p1, where this arc intersects the triangle edges(green points in Figure 3c, bottom). The outside volumecan be further decomposed into one volume correspond-ing to case (a) and an additional “swing” volume whosecomputation we will describe in more detail later.

Finally, for case (d), the two points of intersectionwhere the triangle edges exit the sphere, along with thetwo triangle vertices inside the sphere, form a quadri-lateral region that can be split into two triangles. Onetriangle’s outside volume corresponds to case (a) and theother’s to case (c) (Figure 3d, bottom).

Swing volume lies between two planes hinged betweenthe points p0 and p1 where the triangle edges exit thesphere (green points in Figure 3c, bottom). One of thethese planes is the triangle’s and the other contains p0,p1 and the sphere origin o. The angle between these twoplanes is denoted ϕ.

To compute swing volume, we use a canonical orien-tation where the triangle normal aligns to the y axiswhile the vector p0 − p0 aligns to the x axis. Definel = ‖p1 − p0‖. Without loss of generality, we can assumea unit-radius sphere (r=1), and then scale the result-ing swing volume by r3. The normalized swing volumethen depends on only two parameters, l and ϕ. As apreprocess, we record a 2D table of swing volumes us-ing numerical integration based on the formula derivedbelow.

In Figure 4a, the swing volume is broken into 2Dslices using planes perpendicular to the x axis. One ofthese planes for a particular value of x intersects thesphere in a circle, shown with a dashed outline in Fig-ure 4a. This x plane intersects the swing volume to forma region we denote S(x), colored green in the figure. Itsarea can be computed by subtracting the area of the tri-angle (blue) from the entire sector (yellow), as shown inFigure 4c.

Page 4: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

4 Rui Wang et al.

(a) (b) (c)

Fig. 5 Error metric comparison (2D). (a) polygon and circle,(b) normal-projected metric [7], (c) outside area

(a) signed areas (b) area accumulation

Fig. 6 Outside area accumulation (2D).

The entire volume can be defined as an integral ofS(x) over x from x0 = −l

2 to x1 = l2 . Figure 4b shows

the region S(x) in a simpler 2D projection where theview is now perpendicular to the x axis. The region maybe defined in terms of the variable ry and two constants,

l0 and l1, where ry =√

1 − x2, l0 is the distance of thetriangle plane to the sphere center o, and l1 is the dis-tance of the projection of o onto the triangle plane to thesegment from p0 to p1:

l0 =

1 − (l

2)2 sin(ϕ), l1 =

1 − (l

2)2 cos(ϕ)

The swing volume Vs can now be expressed as

Vs =

∫ x1

x0

S(x) dx

S(x) = (ϕ − sin−1(l0√

1 − x2)) − 1

2(√

1 − x2 − l20 − l1) l0

The first term in S(x) corresponds to the yellow sectorand the second to the blue triangle.

4.2 Accumulating SOTV into SOV

While accumulating SOTV over mesh triangles, the vol-ume must be signed according to two factors: whetherthe sphere center is inside or outside the object, andwhether the sphere center is behind or in front of thetriangle’s plane.

(a) Sphere center inside object. The SOTV is positive ifthe sphere center is behind the triangle plane, and neg-ative otherwise. Total outside volume is thus computedas

Vin(T, S) =∑

tj∩S 6=∅

sign (nj · (pj − o)) V (tj , S)

where tj is a triangle in the mesh T , o is the center of S,nj is the normal of triangle tj , and pj is the projectionof o onto triangle tj . The sign function returns −1 if itsargument is negative and +1 otherwise.

(b) Sphere center outside object. In this situation, weinvert the signs used in (a) and then subtract the resultfrom the total sphere volume, yielding

Vout(T, S) =4π

3r3 + Vin(T, S)

2D Example Figure 6 shows a 2D example with circlecenter inside the object. Unlike our outside volume com-putation in Figure 5c, the approximate error metric from[7] does not handle concavities correctly. For example,the red edge has normal-projected distance of d in Fig-ure 5b, an overestimate which effectively ignores the con-cavity.

Total outside area is accurately computed by travers-ing all edges of the 2D polygon to accumulate their out-side areas one by one. Depending on the position of thecircle center relative to the “outward” halfspace of eachpolygon edge, each area is signed positive (green) or neg-ative (blue). Accumulation of 3D volumes with respectto a sphere is analogous.

5 Minimizing Outside Volume

To find an optimal sphere set approximation for solidobjects, we minimize (4) using a variant of the Lloydclustering algorithm [13]. We discretize the object into aset of points including points on its surface and withinits interior. Lloyd clustering takes place over this set ofpoints and a sphere is used to bound each of the ns

clusters. Clustering iteratively apply three steps: pointassignment to clusters, cluster sphere update, and clus-ter teleportation, until error converges. Each point is as-signed to the cluster whose bounding sphere’s outsidevolume increases least. Given the cluster’s set of assignedpoints, its bounding sphere center and radius are up-dated by minimizing (3). To avoid getting stuck in anundesirable local minimum, the “teleportation” strategyfrom [4] is applied.

Preprocessing A mesh object is discretized into two kindsof points: inner and surface. Inner points are generatedby voxelizing the object into a regular grid and eliminat-ing grid points outside the object. A grid size is manuallychosen to ensure the object’s interior is sampled well.Points on the mesh surface are generated by sorting tri-angles by their areas and sampling points randomly inproportion to these areas [23]. The inner grid points andsurface samples are combined and regarded as the volu-metric representation to be partitioned in clustering.

To initialize the cluster spheres, we randomly choosens inner points for the sphere centers oi and set theirradii ri=0.

Page 5: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

Variational Sphere Set Approximation for Solid Objects 5

Point Assignment A point p is assigned to the cluster itis closest to, based on outside volume (Figure 7). Moreprecisely, the cluster’s bounding sphere radius is enlargedin order to include p, and the enlarged sphere’s outsidevolume (SOV) is computed. p is assigned to that clusterwhose outside volume increases least. In case of a tie, pis assigned to the cluster whose sphere center is closest.

We use a flood fill (stack-based) algorithm to orderthe set of points for cluster assignment. The algorithmstarts from the cluster centers and progresses to adjacentpoints. Once a point is assigned, the bounding sphereradius of its cluster is updated, and its adjacent pointsare pushed onto the stack. Assignment terminates whenthe stack is empty.

Unlike VQ [13], whose point assignment step is order-independent and simply assigns points to the closest clus-ter, our point assignment can not guarantee a decreasein outside volume. In practice, it almost always achievesone. If point assignment yields an error increase, sphereteleportation is triggered (see below). If this fails to de-crease error, the algorithm terminates.

The above (naive) algorithm for point assignment canbe accelerated. Naive point assignment computes n×ns

SOV queries, where n is the number of points and ns

the number of clusters. We can significantly reduce thisnumber by observing that cluster bounding sphere cen-ters oi remain fixed during point assignnment; only theirradii ri are progressively enlarged as more points are as-signed. The current outside volume of each cluster sphereis thus only a function of its current radius. As points areassigned, we keep track of the outside volume for eachcluster sphere as a function of the points’ distance to oi.In other words, we build a table of the relation betweenradius and SOV for each cluster based on its fixed centeroi.

To assign a new point p, for each cluster Ci we lookup a (previously assigned) point q in its table which iscloser to oi than p, yielding a lower bound on p’s outside

(a) initial clusters (b) potential assignment

(c) increased outside volume (d) final assignment

Fig. 7 Point assignment by outside volume. Though pointp is closer to cluster S0’s center than to S1, outside volumeincreases less by assigning it to S1.

volume. By subtracting Ci’s current outside volume fromthis, we obtain a lower bound on the outside volumeincrease without performing a new SOV query.

Using this method, we compute lower bounds on out-side volume increase for assigning p to each cluster Ci. Ifno q closer than p exists in Ci’s table, then we must com-pute the actual SOV for p with respect to oi. We thencompute actual SOV (and trivially, outside volume in-crease) for the cluster having the smallest lower bound.Clusters whose lower bounds are larger can be culledwithout the need to perform an expensive SOV query.

Sphere Fitting Once we have a new cluster assignment,we independently update the bounding spheres of eachcluster Ci. Starting from its old parameters, the clusterbounding sphere Si=(oi, ri) updates its center and ra-dius in order to best approximate the points assigned tocluster Ci. The best center and radius are determinedusing (3), via

argminoiV (T, Si) (5)

while constraining ri to continue bounding all the clus-ter’s assigned points.1 The minimal oi is found usingPowell’s multidimensional minimization [14].

Sphere Teleportation Like many variational methods, thealgorithm easily gets stuck in a local minimum. To avoidthis, we employ sphere teleportation, similar to “regionteleportation” in [4]. Teleportation is triggered when in-sufficient error improvement occurs in cluster assignment/update iterations. The sphere having the maximum over-lap ratio (and thus most redundant) is chosen as the tele-portation source and the largest error sphere is chosenas teleportation destination. Overlap ratio is defined asthe ratio of volume shared with at least one other spherein the set to the total volume.

After teleportation, the teleportation source sphereis deleted and the destination sphere split into two. Thetwo points farthest from each other in the maximum er-ror cluster are chosen as the two initial sphere centers.Another iteration of point assignment and cluster up-date is then computed to evaluate this teleportation. Ifthe new error is less, the teleportation is accepted.

6 Applying Sphere Sets

Animating sphere sets can be achieved by “skinning”based on mean value coordinates [22]. A sphere set is fitto the rest pose and the sphere centers updated as themodel moves using a linear combination of the deformedvertex positions (see [17]). Bounding sphere radii can re-main fixed for typical motions of articulated characters.

1 Actually, to ensure that the sphere set bounds the trianglemesh, each sphere is emlarged as a post-process to bound theedge mid-points and triangle centers of all triangles entirelyor partially inside the sphere [8].

Page 6: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

6 Rui Wang et al.

Er=4.10,ns=575 Er=2.78,ns=128 Er=0.52,ns=64 Er=0.35,ns=64(a) octree [6,12] (b) RS [15] (c) AMAA [3] (e) our approx.

Fig. 8 Method comparison on “Armadillo”.

Sphere hierarchies can be built using a simple bottom-up approach, using our algorithm’s sphere sets as its leafnodes. Hierarchy levels are constructed one at a timefrom the leaves up to the root, based on Lloyd clus-tering. Each cluster stores its current bounding sphere.Clustering iteratively assigns spheres to the closest clus-ter, based on the distance from the sphere center tothe cluster’s, and then updates the cluster’s boundingsphere. Its center is initially taken as the average centerover all spheres assigned to it and then optimized usingPowell’s method to reduce its radius. After convergence,each cluster is made a parent node in the hierarchy; thespheres assigned to it become its children. The next hi-erarchy level above can then be computed by recursivelyclustering over the list of parent nodes just computed.The average branching ratio of the hiearchy is chosen bythe user.

7 Results

To our knowledge, AMAA [3] is the state-of-the-art methodfor sphere set approximation (see Figure 8). We compareour result to AMAA’s, based on visual and geometricerror, and in applications of shadow computation andproximity query. We use the author’s software, availableat http://isg.cs.tcd.ie/spheretree/.

Figure 15 shows some individual objects and assem-bled scenes, using shadow rendering from [17]. More ex-amples are shown in Figure 16. Construction time forone of the models, “Armadillo”, using clustering over5000 points is documented in Figure 9. Our computa-tion time is not much more than AMAA’s, but yields asignificantly better approximation.

Visual and Geometric Error Figure 16 compares our ap-proximation to AMAA using three different sphere setsizes: ns=32, ns=64, and ns=128. Geometric error ismeasured by relative outside volume, Er, the sphere set’soutside volume divided by the original mesh’s volume.Figure 17 graphs Er as a function of ns. Although ourmethod’s curve does not appear dramatically lower thanAMAA’s in terms of absolute error, it should be notedthat both curves flatten out dramatically after an ns

greater than 20-40 spheres. The absolute error value ismuch less important than how many spheres are required

to achieve it. Intersecting the two curves with horizon-tal lines of constant error, it can be seen that AMAAoften requires many more spheres than our approach toachieve the same error – two or three times as many insome cases (e.g. Armadillo graph).

Shadow Application The sphere set can be used as aproxy for rendering the original mesh [18] or its shad-ows [17]. We compare results using sphere sets to castshadows from distant, environmental light rendered us-ing diffuse PRT [20]. A ground plane is used to “catch”shadows underneath the objects and the resulting imagedifferences analyzed in terms of RMS error over all pixelsand all orientations of the lighting environment. Imageresults are presented in Figure 10 (the top row shows theoriginal view while the bottom row shows the groundplane images) and error graphs in Figure 11. Shadowsfrom our sphere sets are significantly closer to the groundtruth shadows, allowing us to use many fewer spheres inorder to achieve results similar to AMAA (see graphs).

Proximity Application We also tested sphere set approx-imations in proximity queries, using a pair of “armadillo”models (Figure 12). The experiments are based on out-side distance queries (Figure 14) which measure the dis-tance of a line segment spent either outside the model(a) or outside the sphere set (b). The line segments forthe queries were generated using 3000 random pairs ofpoints on the two models, sampled uniformly in mesharea. The average difference between the actual outsidedistance and sphere set outside distance, e, is a goodmeasure of the tightness of the sphere approximationand is graphed in Figure 13.

By performing the distance query over line segments,we are able to perform a union over the sphere set bytracking 1D intervals representing sphere entry and exitpoints and counting the nesting levels. The outside dis-tance query thus eliminates overcounting of overlappedoutside volume, unlike our definition in (4). As in theother applications, our method significantly beats AMAA.For example, our method with ns=32 spheres has lessaverage error than AMAA’s with ns=64.

8 Conclusion

We have tested our variational approach on many mod-els including simple and complex ones. Our method out-performs alternatives such as the octree and medial-axismethods, as we’ve demonstrated using visual and quan-titative comparisons and in applications involving shad-owing and proximity detection. In many cases, our al-gorithm’s sphere sets work as well as the current bestalternative’s with only 33-75% as many spheres.

Our algorithm’s effectiveness is based on two factors.One is a suitable definition of error, which we formu-late in terms of outside volume. Our error metric con-siders only volume of the sphere set outside the input

Page 7: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

Variational Sphere Set Approximation for Solid Objects 7

Fig. 9 Sphere-set construction time.

(a) original mesh (b) our approx. (c) AMAA

Fig. 10 Sphere set shadows, ns = 48.

Fig. 11 Graphs of shadow error.

(a) original mesh (b) our approx. (c) AMAA

Fig. 12 Proximity query scene

Fig. 13 Proximity query error.

(a) actual (b) using sphere set

Fig. 14 Outside distance.

geometry and neglects how much the spheres overlap inthe object’s interior. This is appropriate for solid ob-ject approximation in applications based on intersectionand proximity. The second factor is to solve the resultingminimization problem using variational partitioning andfitting, which provides a more direct and more globalsolution than previous methods.

Our method’s extensive computation limits it to spheresets having no more than a few hundred spheres. Fortu-nately, object approximation with such a limited numberof spheres suffices for many interesting real-time applica-tions as we have shown. To generate larger sphere sets,heuristics such as simple Lloyd (L2) clustering can beused to form initial bounding spheres and then a few it-erations of outside-volume minimizing cluster iterationapplied.

Acknowledgements This project was partially supportedby 973 Program of China (No. 2002CB312104), NSFC (No.60021201) and Specialized Research Fund for the DoctoralProgram of Higher Education of China (No.20030335083).

References

1. Amenta, N., Choi, S., Kolluri, R.K.: The power crust.In: SMA ’01: Proceedings of the sixth ACM symposiumon Solid modeling and applications, pp. 249–266. ACMPress, New York, NY, USA (2001)

2. van den Bergen, G.: Efficient collision detection of com-plex deformable models using AABB trees. J. Graph.Tools 2(4), 1–13 (1997)

3. Bradshaw, G., O’Sullivan, C.: Adaptive medial-axis ap-proximation for sphere-tree construction. ACM Trans.Graphic. 23(1), 1–26 (2004)

4. Cohen-Steiner, D., Alliez, P., Desbrun, M.: Variationalshape approximation. ACM Trans. Graphic. 23(3), 905–914 (2004)

5. Gottschalk, S., Lin, M.C., Manocha, D.: OBBTree: A hi-erarchical structure for rapid interference detection. In:Proc. of ACM SIGGRAPH 1996, pp. 171–180 (1996)

6. Hubbard, P.: Interactive collision detection. In Proceed-ings of the 1993 IEEE Symposium on Research Frontiersin Virtual Reality 14(2), 24–31 (1993)

7. Hubbard, P.: Collision detection for interactive graphicsapplications. PhD thesis (1995)

8. Hubbard, P.: Approximating polyhedra with spheres fortime-critical collision detection. ACM Trans. Graph.15(3), 179–210 (1996)

9. James, D.L., Pai, D.K.: BD-tree: output-sensitive col-lision detection for reduced deformable models. ACMTrans. Graphic. 23(3), 393–398 (2004)

10. Klosowski, J.T., Held, M., Mitchell, J., Sowizral, H.,Zikan, K.: Efficient collision detection using bounding

Page 8: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

8 Rui Wang et al.

volume hierarchies of k-DOPs. IEEE Transactions onVisualization and Computer Graphics 4(1), 21–36 (1998)

11. Krishnan, S., Pattekar, A., Lin, M., Manocha, D.: Spher-ical shells: A higher-order bounding volume for fast prox-imity queries. In Proceedings of the 1998 Workshop onthe Algorithmic Foundations of Robotics pp. 122–136(1998)

12. Liu, Y., Noborio, J., Arimoto, S.: Hierarchical spheremodel HSM and its application for checking an inter-ference between moving robots. In Proceedings of theIEEE International Workshop on Intelligent Robots andSystems pp. 801–806 (1988)

13. Lloyd, S.: Least squares quantization in PCM. IEEETransactions on Information Theory IT-28(2), 129–137(1982)

14. Press, W., Teukolsky, S., Vetterling, W., Flannery, B.:Numerical Recipes in C: The Art of Scientific Computing.Cambridge University Press, New York, NY, USA (1992)

15. Quinlan, S.: Efficient distance computation between non-convex objects. IEEE Intern. Conf. on Robotics and Au-tomation pp. 3324–3329 (1994)

16. Ranjan, V., Fournier, A.: Union of spheres (UoS) modelfor volumetric data. In: SCG ’95: Proceedings of theeleventh annual symposium on Computational geometry,pp. 402–403. ACM Press, New York, NY, USA (1995)

17. Ren, Z., Wang, R., Snyder, J., Zhou, K., Liu, X., Sun,B., Sloan, P., Bao, H., Peng, Q., Guo, B.: Real-time softshadows in dynamic scenes using spherical harmonic ex-ponentiation. To appear in Proc. ACM SIGGRAPH 2006(2006)

18. Rusinkiewicz, S., Levoy, M.: QSplat: A multiresolutionpoint rendering system for large meshes. In: Proc. ACMSIGGRAPH 2000, pp. 343–352 (2000)

19. Ruspini, D.C., Kolarov, K., Khatib, O.: The haptic dis-play of complex graphical environments. In: Proc. ofACM SIGGRAPH 1997, pp. 345–352 (1997)

20. Sloan, P., Kautz, J., Snyder, J.: Precomputed radi-ance transfer for real-time rendering in dynamic, low-frequency lighting environments. ACM Trans. Graphic.21(3), 527–536 (2002)

21. Tam, R.C., Fournier, A.: Image interpolation usingunions of spheres. pp. 401–414 (1998)

22. Tao, J., Schaefer, S., Warren, J.: Mean value coordi-nates for closed triangular meshes. ACM Trans. Graphic.24(3), 561–566 (2005)

23. Turk, G.: Generating random points in triangles. In:Graphics gems, pp. 24–28. Academic Press Professional,Inc., San Diego, CA, USA (1990)

24. Wu, J., Kobbelt, L.: Structure recovery via hybrid varia-tional surface approximation. Computer Graphics Forum24(3), 277–284 (2005)

Rui Wang received his B.S. in computer science from Zhe-jiang University in 2001. He is currently a Ph.D. candidatein the State Key Laboratory of CAD&CG of Zhejiang Uni-versity. His research interests are image-based modeling, ma-chine learning and geometry approximation.

Kun Zhou is a researcher/project lead of the graphics groupat Microsoft Research Asia. He received his B.S. and Ph.D.in Computer Science from Zhejiang University in 1997 and2002 respectively. His current research focus is geometry pro-cessing, texture processing and real time rendering. He holdsover 10 granted and pending US patents. Many of these tech-niques have been integrated in Windows Vista, DirectX andXBOX SDK.

John Snyder is a Principal Reseacher at Microsoft Research.He received a B.S. from Clarkson University in 1984, a Ph.D.from the California Institute of Technology in 1991, and hasbeen at Microsoft Research since 1994. His research interestsinclude geometry representation and processing and real-timealgorithms for global illumination.

Xinguo Liu received a B.S. in 1995 and a Ph.D. in 2001 fromthe Department of Applied Mathematics in Zhejiang Univer-sity. He is currently in the State Key Lab of CAD&CG, andis a Professor of the Computer Science School in ZhejiangUniversity. Before joined CAD&CG in 2006 April, he was aresearcher of the Internet Graphics Group in Microsoft Re-search Asia. His main research interests are in appearancemodeling, real-time rendering, geometry processing and de-formable objects.

Hujun Bao received his B.S. and Ph.D. in applied math-ematics from Zhejiang University in 1987 and 1993 respec-tively. His research interests include modeling and renderingtechniques for large scale of virtual environments and theirapplications. He is currently the director of State Key Lab-oratory of CAD&CG of Zhejiang University. He is also theprincipal investigator of the virtual reality project sponsoredby Ministry of Science and Technology of China.

Qunsheng Peng is a Professor of computer graphics at Zhe-jiang University. His research interests include realistic imagesynthesis, computer animation, scientific data visualization,virtual reality, bio-molecule modeling. Prof. Peng graduatedfrom Beijing Mechanical College in 1970 and received a Ph.Dfrom the Department of Computing Studies, University ofEast Anglia in 1983. He serves currently as a member of theeditorial boards of several international and Chinese journals

Baining Guo is the research manager of the internet graph-ics group at Microsoft Research Asia. Before joining Microsoft,Baining was a senior staff researcher in Microcomputer Re-search Labs at Intel Corporation in Santa Clara, California,where he worked on graphics architecture. Baining receivedhis Ph.D. and M.S. from Cornell University and his B.S. fromBeijing University. Baining is an associate editor of IEEETransactions on Visualization and Computer Graphics. Heholds over 30 granted and pending US patents.

Page 9: Variational Sphere Set Approximation for Solid Objects · 2014-05-22 · Variational Sphere Set Approximation for Solid Objects Abstract We approximate a solid object represented

Variational Sphere Set Approximation for Solid Objects 9

(a) T. Rex, ns=64 (b) Bunny, ns=60 (c) Diplodocus, ns=64 (d) Human, ns=256

(d) Battle scene (e) Dinosaur scene

Fig. 15 Sphere set approximation for different objects and scenes.

orig.

ns=32

Er = 0.66 Er = 0.57 Er = 2.19 Er = 1.36 Er = 1.07 Er = 0.85 Er = 1.83 Er = 1.20

ns=64

Er = 0.52 Er = 0.35 Er = 1.00 Er = 0.64 Er = 0.74 Er = 0.56 Er = 0.95 Er = 0.62

ns=128

Er = 0.34 Er = 0.25 Er = 0.55 Er = 0.31 Er = 0.50 Er = 0.35 Er = 0.43 Er = 0.30

AMAA our approx. AMAA our approx. AMAA our approx. AMAA our approx.Armadillo Dragon Lion Female

Fig. 16 Sphere set comparison with the AMAA method.

Fig. 17 Graphs of relative outside volume vs. ns.