Interactive global and local deformations for virtual clay

  • Published on
    21-Jun-2016

  • View
    216

  • Download
    0

Transcript

*the model exhibits several important features of real clay, namely plasticity, mass conserva-very simple and intuitive way to create complex shapes: even children use clay atwww.elsevier.com/locate/gmodGraphical Models 66 (2004) 3523691524-0703/$ - see front matter 2004 Elsevier Inc. All rights reserved.* Corresponding author. Fax: +33 476615440.E-mail addresses: Guillaume.Dewaele@imag.fr (G. Dewaele), marie-paule.cani@imag.fr (M.-P. Cani).tion, and surface tension eects. These features make the model intuitive, since the userobtains the shapes he expects, as demonstrated by our results. 2004 Elsevier Inc. All rights reserved.Keywords: Virtual clay; Shape modeling1. IntroductionCompared to traditional tools for numerical shape modeling, real clay remains aGuillaume Dewaele, Marie-Paule CaniGRAVIR-IMAG, GRAVIR is a joint lab of CNRS, INRIA, Institut National Polytechnique deGrenoble and Universit Joseph Fourier, FranceReceived 4 February 2004; received in revised form 28 April 2004; accepted 23 June 2004Available online 17 September 2004AbstractMaking virtual modeling as easy and intuitive as real-clay manipulation is still an unsolvedproblem. This paper takes a step in this direction: in addition to oering standard featuressuch as addition and removal of material, it uses a new real-time plasticity model to let theuser apply local and global deformations such as those made in real clay by pressing with anger or bending a sculpture with one hand. Although not completely physically accurate,Interactive global and local deformationsfor virtual claydoi:10.1016/j.gmod.2004.06.008G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 353school. Many artists prefer expressing themselves with real materials instead of usinga computer.If one could get the benets of real clay in a computer-based modeling system, onecould have the best of both worlds: virtual clay would neither dry nor crack; it couldbe mutated from softer to dryer states as needed; the artist could pause at any time,and return to work as convenient without worrying about material changes in theinterim. Furthermore, gravity would no longer be a problem, so shapes than cannotbe made easily with real material would become possible. Finally, the advantages ofany computer-based modeling tool would apply: the artist would be able to work atany scale and use any size of tool, simplifying the production of ne details as well asglobal features, and virtual modeling would allow copy/paste, undo, etc., as well asmore clay-specic ideas such as temporarily removing a part of the model to ease theediting of hard-to-reach areas.Although previous virtual clay models oer real-time interaction and a number ofinteresting features, most were either restricted to carving and adding material, oradapted solely to surface deformation, not allowing topology modication. Andthe operations they supported often failed to provide an intuitive interface for mod-eling, because some of the dening features of clayits constant volume, its surfacetensionwere not simulated in the systems.This paper proposes the rst volumetric, real-time virtual clay model which can beboth sculpted by adding and removing material, and deformed through interactionwith rigid tools. Either global or local, the deformations mimic the eects of the toolson real clay, due to plasticity, mass conservation, and surface tension.1.1. Related workAlthough an impressive number of computer graphics works have used the termsculpting [2,3,1214,16,18,20,22,23,30,31] or even clay [7,19], none has provided areal-time model that mimics the main feature of real clay, namely the ability to un-dergo plastic, constant volume deformations in addition to matter addition and re-moval. The previous approaches fall into three main categories: empirical surfacemodels, empirical volume models, and physically based models.The rst group of interactive sculpting methods relies on surface representations[3,18,20]. Such representations ease the application of interactive deformations, butrequire the use of complex mechanisms for enabling topological changes. Moreover,these geometric models cannot easily provide the same features as the interactionwith a volumetric material, such as constant volume deformation.Volumetric models [1,1114,22,23] are much closer to real clay: most of them aredened using a scalar eld, which is either stored in a grid or controlled throughprimitives such as B-spline volumes. The surface of the object is an isosurface of thiseld, which plays a similar role than a density of material. This representation is veryadequate to the application of volumetric operations, such as carving the object oradding material, performed through local editing of eld values. These volumetricrepresentations therefore handle any kind of topological change without the needof any specic mechanism. Only local deformations with no volume conservation354 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369were dened [12]. Solutions using cellular automata have been purposed to computelocal deformations of a virtual clay [1,11] or sand [21]. Interactive free-form model-ing with volume conservation and topological changes are possible. However, noneof these models provides the ability to deform the piece of clay, as an artist would dowhile putting the limbs of a model in the right posture.Although physically based modeling is a good way to ensure intuitive results whendeforming shapes, it has hardly been applied to virtual clay models. Real clay liessomewhere between viscous uids [27] and plastic solids [26]. All previous physicallybased clay models [19,28,30] relied on the plastic solid representation. A plasticbehavior can easily be obtained by extending an elastic model. Typically, an objectsrest shape is given the ability to locally absorb the deformations that exceed a giventhreshold [26]. In such models, applying the very large deformations that real claycan undergo, including local matter displacement, would require frequent re-mesh-ing of the model. In particular, enabling topological changes (such as separationof matter into several pieces) appears incompatible with real-time performance, sincemost real-time deformable models exploit the materials internal structure for prein-verting matrices or pre-computing hierarchies [6,8,15,17]. Therefore, none of the pre-vious physically based clay models allows the simulation of very large deformations,including relative matter displacement inside the shape, carving, fusion, and separa-tion. Geometric topological changes were however made possible using a cleverlyadapted representation, i.e., subdivision solids [19]. But these changes in topologystill required the user to specify which cells should be deleted or joined.If we look upon the uid modeling side, some non-real-time particle-based modelswere used to represent very viscous material [5,27,29], somewhat similar to clay.Real-time performance was only obtained in Eulerian uid simulations [24,25], forwhich the uid was occupying the entire space (in contrast to clay, which is boundedby a time-varying surface).1.2. OverviewAs we just saw, none of the previous real-time deformable model exhibits the fea-tures of clay we would like to mimic. The main contribution of this paper is to de-scribe a new deformable model for virtual clay that does capture these features.Although it was inspired by the way real material behaves, our model does not fullycapture the physics of clay. We believe that its capability to exhibit the main char-acteristic of clayextreme plasticity, including enabling relative matter displacementinside the block of material, topological changes, constant volume, surface tensionwill be sucient for the user to recover the feeling he gets when interacting with realclay.Our model exploits a layered approach for achieving this goal with real-time per-formance: based on a standard volumetric representation (i.e., mass density valuesstored in a grid), it uses the combination of three independent deformation layersfor providing the desired behavior. These three layers, respectively, model large-scaledeformations, mass conservation (which yields smaller-scale matter displacement),and surface tension. These layers are activated successively during each time step.be easily implemented; we currently use the algorithms described in [12].G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 355The remainder of this paper focuses on our new contribution: the ability to de-form the clay in real time, without modifying the underlying quantity of material.2.2. Deforming virtual clayIn our representation, deforming clay just requires decreasing the eld function insome regions, while increasing it in others. Since the quantity of material should notbe modied, we basically have to add to some cells the exact quantity of matter weare removing elsewhere, thus modeling matter displacement.Since they share the same underlying volumetric representation, coherence is en-sured, a layer being immediately aware of the changes of the clay state due to theaction of the other layers.The remainder of this paper develops as follows: Section 2 describes our represen-tation for clay and motivates the use of multiple layers for the simulation. Section 3details our three layers. Section 4 deals with real-time rendering. Section 5 presentsresults. We conclude and discuss future work in the last section. This paper is a re-vised version of the work we presented at Pacic Graphics 03 [9].2. Our clay model2.1. Volumetric representationSince we are working with a solid material, a volumetric representation is a nat-ural choice. It permits easy modeling of topological changes, which is quite impor-tant if we want to be able to carve and deform any kind of shape.We thus describe our material with a scalar eld function dened on 3-space. It isdiscretized on a regular grid, and values at non-grid-point locations are interpolatedfrom neighboring grid-point values. In standard implicit modeling [4], eld valueshave no intrinsic meaning: they serve only to distinguish inside from outside, andadjusting them by any positive factor makes no dierence to the model. One canuse this freedom to store additional information in the scalar eld, such as the dis-tance to the level-zero surface [22]. Since we are trying to simulate material behavior,we choose insteady to give this eld function a dierent meaning: it represents thedensity of matter within the object. More precisely, each value on a grid node cor-responds to the quantity of matter in a cubic cell surrounding this node. When thisvalue is zero, the cell is void.Since we want to model uncompressible virtual clay, each cell shall only contain alimited quantity of matter. By convention, a eld value equal to 1 denotes a full cell.The surface of the clay is dened as an isosurface of mass density, i.e., we are insidethe material when the density reaches a given threshold between 0 and 1.Adding clay material (respectively, removing clay) is done by increasing (respec-tively, decreasing) the eld values in regions covered by a tool, exactly as was done inprevious approaches [12,14,22]. Similarly, smoothing and undoredo operators canbehavior we are looking for. The next section details the three layers.356 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 3523693. Simulation of the virtual clay3.1. Large-scale displacementsA natural way to simulate large-scale deformations of clay is to rely on the pre-vious work on elastic and plastic models. This could for instance be done by attach-ing a mass-spring network (or an FEM), at each time step, to the currentconguration of the clay, and use its deformation to move material. The underlyingvolumetric representation would then serve as a basis to ease locating and re-mesh-ing the material. This approach, which we tried rst, quickly raised some eciencyissues: while standard elastic and plastic models always use the same network ofnodes, which enables optimizations, we had to re-compute the network at each timestep, as our sculpture experienced very large deformations and topological changes.Results were thus far from real time, even using a simple spring model and implicitintegration. Moreover, the dynamic behavior of masses and springs was unneces-sary, since clay can be seen as a fully damped material.We therefore looked for a much faster method, one that could provide in one stepthe same kind of displacement eld the mass-spring network would have reached atequilibrium, even if its accuracy would be limited. We found inspiration in uidmechanics: when an element in a viscous uid moves, it pulls nearby uid elementswith it. In fact, the quantity of movement diuses in the uid: faraway elements areSince no previous physical-based model succeeded in simulating a material similarto clay in real time, our approach is to directly model the main observed features ofreal clay, i.e., to take a phenomenological approach: Real clay mainly undergoes totally damped, plastic deformations. Although somedynamic eects and limited-range elasticity can be observed in real clay, we foundthese negligible in practice. Clay is uncompressible, and thus preserves its volume during deformation. Although some small pieces may separate from the block of material during inter-action, the material usually holds together, a behavior we can attribute to a cer-tain amount of surface tension.Mimicking these features can be done by combining three layers, each modeling aspecic aspect of the clay behavior. The rst layer handles large-scale eects. Thislets the user bend or twist parts of the sculpture. A second layer enforces volumeconservation, which may not be exactly ensured by the rst layer. Volume preserva-tion will yield local eects resembling footprintsdented in the middle, raised at theedgesin areas where a tool pushes the clay. Finally, the third layer acts as a surfacetension mechanism, in order to keep the material as compact as possible. These lay-ers could be activated separately, since they all directly edit the volumetric represen-tation of the clay. But their combination is necessary for achieving the natural clayG. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 357pulled less than nearby ones. We thus decided to use a similar approach, by diusinginside the clay the displacements dictated by user-controlled tools.At each time step, when a tool intersects the clay after moving towards it, we cal-culate the exact time of the collision and the tool displacement since the collision oc-curred. We also look for the cells covered by the tool. Clay in those cells is moved bythe tool, and that movement is further transmitted from cell to cell, moving clay thatis farther away from the tool.We use a propagation scheme inside the clay to get all the cells that will be aectedby the tools motion. And we compute a pseudo-distance to the tool for each cellaected. This pseudo-distance is not supposed to approximate the Euclidean dis-tance. It rather represents the local inuence of the tool: the greater this factor,the less the movement of the tool has impact on the cell.Starting from the cells close to the tool, we compute the distance from cells to cellsuntil we reach the borders of the object, xed cells, or cells attached to other tools.The distance for a cell is computed simply by adding 1densityto the minimal distancealready computed for close cells.To perform that propagation, we use a stack containing cells. All cells inside ofthe tool are placed in the stack, and their distances are xed to zero. The other cellsare initialized with an innite distance to the tool. Then, for each cell i in the stack,we compare the current distance to the tool dj of each neighbor j to the termdi 1densityi. If it is greater, dj is updated, and the cell j is put in the stack if it is notalready in it. These operations are performed as long as there is cells in the stack.Inside of the object, the result obtained is similar to the Manhattan distance(although it does not compute distance along straight lines but rather follows theshape of the object). But in areas where the density is low, the inuence of the tooldecreases more quickly. This will favor tears near the weak points of the object.We could use a more complex propagation scheme to compute the distance, bytaking into account the 26 closest cells (and using2pdensityand3pdensity) instead of thesix closest ones. We would obtain a better approximation of the distance than theprevious near-Manhattan distance. But, in practice, while the results are slightly im-proved in a few cases, computations become quickly more expensive, and it is oftenmore interesting, if you can aord it, to use a ner discretization of the workingspace.We then compute a displacement eld for all the cells under the inuence of thetool. When a single tool is used, we can either give to all the matter the exact toolsdisplacement (which will rigidly move the closest connected part of the clay with thetool), or decrease the amplitude of displacement according to the pseudo-distance tothe tool (this way, matter far from the tool will not move). However, in the lattercase, the user would have to tune the way the displacement decreases, and restrictingdeformations to the desired regions may be non-intuitive.In practice, we do not use this second solution, since, as in real life, the user al-ways uses a support to hold a part of the clay when sculpting. This support can,for instance, represent a table on which the model lies, a wall towards which it iscompressed or ngers holding the clay, but may also consist of any set of selectedcells inside the object in which matter displacement is clamped to zero. Whateverits shape and number of connected components, the xed region is treated as a sec-ond, immobile tool.3.1.1. Combining tools and static regionsSuppose that we have cells that are under the inuence of two (or even more)tools. The movement of the clay in those cells will be a combination of the move-ments dened by the two tools. Matter close to the rst tool should have the samemovement as this tool, and the same for clay in cells close to the other tool. Clayin between should have a intermediate interpolated movement. We use the pseu-do-distance to the dierent tools, introduced in the previous section, to measure theirrespective inuence on a given cell.Let us call d1 the pseudo-distance from the cell to the rst tool and d2 the pseudo-distance to the second one. Let d12 be the pseudo-distance between the tools (i.e., the358 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369lowest pseudo-distance we get between a cell attached to the rst tool and one at-tached to the second one). We use the coecient k d1d2d12 to express the relativeinuence of the two tools on the cell. For cells where k = 0, the two tools havethe same inuence. When k < 0, matter in the cell is more inuenced by the rsttools motion than by the second ones motion.We apply to the matter in each cell a displacement vector d that is a linear com-bination of the displacement vectors d1 and d2 of the two tools as follows:d 1 k2d1 1 k2d2: 1Since we currently use only a single input device, most of the time, only a single toolis moving, while all the other tools are static. The user can also select cells where mat-ter cannot move. We compute the inuence of all those static tools in the clay, thenthe inuence of the moving tool, and we use the previous equation with d2 = 0 (cor-responding to the non-motion of the static tools) and d1 corresponding to the dis-placement of the tool currently manipulated by the user (see Fig. 1).When the user wants to use two moving tools at the same time (by using scriptedmovements, or symmetric behavior for the tools), we restrict the number of toolsFig. 1. Respective inuences of a moving tool and a static tool inside an object and the correspondingdisplacement eld for clay.available in the scene to two, so that we can compute d. However, it is no more pos-sible to specify cells where clay will not move in this case.3.1.2. Rotating toolsUp to this point, we only considered that tools motion would be translationswhen they are in contact with the clay. However, the user may also rotate tools,expecting to produce rotations or twists in the clay (see Fig. 2).Solid rotating objects have a motion that cannot be described by using only a dis-placement vector di, but any point A rigidly linked to the tool moves according to thefollowing displacement eld:G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 359dA dO OA x; 2where dO is the translation of the center of the tool O and x is the screw of the tool.We replace the previous di in Eq. (1) by the dA for cell i (note that dA is this timedierent for each cell in space) in Eq. (2) to take into account rotations of the tool.This way, we are able to generate more general deformations. For instance, it is pos-sible to twist a bar of clay by simply rotating two tools placed at the ends of the barin opposite ways. Examples of bending and twisting can be seen in the last section ofthis paper.3.1.3. Moving matterOnce the displacement vector in each cell is evaluated, we only have to move mat-ter according to this displacement eld. We remove matter from each cell where theeld is non-zero, and put it in the cell whose position is d relative to the original cell.In general, this new position will not be the center of a grid cell, so the matter is dis-tributed among the eight surrounding nodes, the closest ones receiving the greatestcontributions. We simply use a linear interpolation: if (x, y, z) is the destination pointand (xn, yn, zn) is the position of one of the eight closest nodes, this node will receivethe quantity of clayqn q 1kx xnkdx 1 ky ynkdy 1 kz znkdz ;where q is the total quantity of clay we want to move and dx, dy, and dz are the spac-ings of our grid cells along the three axis. This is illustrated by Fig. 3.Fig. 2. Displacement eld induced by a rotating tool and combination of two elds in order to bend a barof clay.360 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369Unfortunately, the displacement eld just computed does not satisfy the conditiondiv(d) = 0, so we would normally see changes in the volume of the object. The vol-ume conservation layer of our simulation will address this.3.1.4. Changing the behavior of clayWe have found it useful to have a way to change the behavior of our clay. Realclay can contain a variable quantity of water, and thus its behavior can range fromplastic to almost uid. With a very uid clay, the tool does not transmit its move-ment to the clay as well as it does with plastic clay.We have two ways of adjusting the clay behavior. The rst simply adds a constantto the pseudo-distance between a cell and the tools. This way, the movement of anytool will be less eciently transmitted to the clay.The second solution consists of using a fraction a of the tool displacement, wherea lies between 0 and 1. Results are quite similar. We currently use this second solu-tion, because even if it is not correct (it lacks, for example, symmetry between staticand moving tools), it is easier for the user to understand and to use: a factor near onegives a very dry clay; a factor near zero gives a very uid behavior.3.2. Mass-conservation layer3.2.1. PrinciplesThe mass-conservation layer of the simulation aims at enforcing volume conser-vation. It also models local matter displacements near the surface of the object due tothe tools action. It will result in prints when the user pushes the tool on the object, infolds, etc. Of course, none of these eects can be produced by the previous layer. In-deed, the clay needs to locally move laterally and then even in the opposite directionfrom the tool to create bumps and folds around it.Fig. 3. Moving clay between cells.The idea behind this layer is quite simple: if, in a cell, the density is greater thanthe maximum allowed value, 1, the excess is distributed into the six closest cells.When those cells are not full, the process terminates. If they have an excess of matter,they will distribute it among their own closest cells, and so on. Matter will movefrom cells to cells and nally reach the objects border, where it will nd some roomto remain. We will see that the object inates in those areas.We found the ideas behind this layer in uid mechanics. When the medium seeslocally an excess of pressure (i.e., an excess of matter), we get motions of the uidfrom the areas with high pressures to areas with lower ones, until a uniform pressureis obtained. The main dierence is that we only consider excess with regard to themaximum density and do not compare it to the surrounding values. This way, ourclay remains solid, and does not tend to occupy the whole space.3.2.2. Interaction with toolsNow we need to see how tools can interact with our mass-conservation layer. Wewant the tool to push the clay in front of it when the user presses the tool against theobject. The interaction is quite straightforward: where we have a tool, there is nomore room for matter. The cells covered by the tool cannot contain clay anymore,so all the clay in those cells is in excess. We use the process we just described for mov-ing this matter (see Fig. 4).Rather than using purely rigid tools, we limit aliasing artifacts by dening themusing a density function. The tools density decreases near its edges. When the tooloccupies 80% of a cell (i.e., its density value in the cell is 0.8), there is room for 20%G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 361of clay. Thus the carved object will have the same roughness as the tool. It is possi-ble, too, to use a previously sculpted piece of clay as a tool. We thus let the user de-sign his own complex tools, for example to be able to make prints or bas reliefs.A small problem remains. If we simply move matter inside the tool to all closecells, some clay can go through the whole tool and exit on the other side. We thusadd one more rule for interacting with tools: clay inside tools can only move out-wards. For each cell occupied by the tool, we dene allowed and forbidden directionsamong the six possible directions to nearby cells. This way, tools really push matterin front of them, and no clay goes through the center of the tool.For eciency reasons, we pre-compute those allowed directions when we design atool. This is done by looking for the closest direction to the surface of the tool. Wecould simply use the (discrete) gradient of the tools eld function. But this will notwork for tools sculpted within our system, since we clamped the eld value to 1 in-side the tool. We need a second eld function, with no clamping value this time, sothat the gradient can be meaningfully computed anywhere. If we have only a eldfunction already clamped to 1 to describe the tool, we have to build this second eldFig. 4. Movements of clay inside the object, following a movement of the tool.362 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369function. This can be done by using a propagation scheme starting from the edges ofthe tool, and going inside. We use the same algorithm we described in the large-scaledisplacement algorithm to compute the inuence of the tools, except we got rid of the1=density term. This way, we have everywhere an estimation of the distance to thesurface of the tool, and the gradient points towards the outer part of the tool. Thiscomputation is performed each time we convert a piece of clay into a new tool.Moving clay in one direction is allowed if this direction makes an angle with thedirection of the gradient under a given threshold. We choose to use a 60 angle. Wenormalize gradient, and we compare its components to 0.5 and 0.5 to decidewhether motion along the x-, y-, and z-axes should be allowed.3.2.3. Implementation issuesTo implement eciently, we simply use a le (i.e., a rst-in-rst-out queue) whichcontains all the cells which could have an excess of matter. So we take the rst cell ofthe le, check for an excess, and if there is one, move it in the closest cells and putthese cells in the le. We added a ag to each cell to prevent a cell from being in thele more than once.We do this until the le is empty, or we reach a given number of iterations. Thiscould seem expensive computationally, but it is a very simple scheme, so we can eas-ily do a few hundred of thousands of iterations. One important thing to see is thateven if we stop iterating, matter will not be lost: we will simply nish the work later,at the next simulation step.For convergence, we consider that there is no more excess in a cell as soon as a cellcontains less than a threshold a bit higher than 1 (for example we can use 1.01). Thelittle variations in the volume of the object would not be noticed by the user. Thisthreshold can be adjusted if we want more precision or faster simulation.Another thing has been done to get a faster result: we do not want clay to go froma cell to another, and then come back to the rst cell. We could try to rememberfrom where the clay was coming, but it simply do not work because clay can arrivein a cell from several directions. Instead, we move more clay than needed, taking intoaccount that one-sixth of it will come back in the cell.3.3. Surface tensionAfter several deformations using the two layers above, the matter tends to becomeless and less compact. Clay pushed by the tools can indeed be dispersed around theobject, and the transition from inside (density equal to 1) to outside (void cells) getsslower and slower. One of the problems with cells with low densities is that the userdoes not see them, so strange eects can arise if a tool pushes these small quantitiesof clay in front of it: clay popping from nowhere when density, due to action of thetool, rises to the threshold; inaccurate changes of the surface location, etc. Moreover,since matter in cells of low density is no longer visible, the objects volume will seemto decrease, even if matter does not really disappear.The surface tension layer tries to resolve and avoid these problems. It keeps thegradient of density near the surface of the clay to an acceptable value. Matter in cellshad been eaten up by the clay.G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 3634. Real-time rendering4.1. O-line renderingMost of the time, we simply use the marching cubes algorithm to render the claysurface. Because connectivity can change during deformations or carving, we need toexplore the whole space to get all the disconnected parts of the object. As this is com-putationally expensive, we cannot do it for each frame. So we only update trianglesin regions where the density has changed, as it was already suggested [14]. Each timea cells density is modied, the eight cubes around the node are marked as changed.When the scene must be displayed, all the cubes that have been marked are updated,and triangles inside of them are changed. Unfortunately, when the user bends a largepart of the object, this method becomes quite expensive computation-wise, since a lotof cells will be updated. To save as much computing time as possible for the simu-lation loop, we designed a fast rendering method to take care of such situations.4.2. Fast rendering during interactionOur fast rendering technique is based on raycasting. We throw rays along one ofthe axes of the scene (e.g., the z-axis) and we search for the rst intersection of theray with the surface. Since we throw rays along an axis of the discretization grid, wewith very low densities is moved to nearby cells with higher densities. We look forevery cell with a value below a threshold (in our implementation, we use 0.3, andan isovalue of 0.6). At each such cell, we compute the gradient of the eld functionby using nite dierences with nearby cells. If the length of the gradient is below an-other threshold (which correspond to the gradient we would like to have near thesurface of the object), we move clay from the cell with a low density to closest cellswith higher ones. This way, the object remains compact. The layer can be seen asadding a surface tension eect for a uid.While the previous layer prevents contraction of our clay, this layer tries to avoidexpansion. This will separate the object in two dierent compact parts when the usertries to stretch it too far. Indeed, if you try to cut an object in two, the area betweenthe two pieces will have a decrease of density. When the middle area density falls be-low our threshold, the matter is divided between the two parts, and the object iseventually cut in half.Even with surface tension, some very small pieces of matter may separate from themain block of clay, like crumbs from a piece of toast; these are sets of a few neigh-boring cells with above-threshold densities. This is still physically correct, and theuser should not be surprised, since these crumbs are visible. But because they canbe distracting for the user, we get rid of them as soon as possible by removing themfrom the working space. If we want to preserve the volume of the object, we can putthe matter removed this way back in the closest cell with high density, as if the crumbonly need to look for the rst node of each row parallel to the axis which contains avalue above the threshold. The exact point of intersection with the surface can beobtained by linear interpolation between this node and the previous one.We build this way a heighteld z = f (x,y). The result we obtain looks like a cloththrown on the objects. Of course, we do not have the back side of the object any-more, nor the parts behind others. So we have to choose an axis close to the cameradirection.Directly rendering the heighteld would not be a good solution: when we havetwo objects, one of them partially behind the other, they would be merged (seeFig. 5). So we instead rene our surface by casting additional rays in areas wherez varies quickly, and we only draw triangles between points with nearby z values.This way, we get more precise contours, too.As soon as we have time (when the user removes the tool from the clay, for in-stance), we update all the cells marked, and go back to marching cube rendering.As we can measure the time taken by computation for the simulation, and we knowhow many cells have to be updated, it is quite easy to decide when we must switch tofast rendering, and go back to marching cubes.364 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369Fig. 5. Glitches in upper left picture are solved by casting additional rays. The result obtained by ourmethod is shown below.near farupdate zfar.G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 365Sometimes, the value of the cell located at zfar falls below the threshold. If thisarrives, there may be no more cells between znear and zfar whose value is above thethreshold. So we set zfar as the last index of the row to be able to nd the intersection(if there is one). It can happen when matter is pushed away from the camera or shiftslaterally.All those changes to znear and zfar are done during simulation. When we want torender the image, we simply have to look for the correct z value of intersection be-tween znear and zfar. Then we reset znear and zfar for the next time step.The reason why this approach is quite fast is that we often have to look for z onlyin very small areas. Where objects do not move or in areas where rays do not inter-sect the clay, there is no computation to do; when matter moves towards the camera,we also have no computation, and when it moves away, we will only check one ortwo cells. In fact, only lateral shifts can be expensive around the silhouettes, but thiswill generally only aect a small number of rays.5. ResultsOur results were obtained by letting the user specify regions where the clay isstatic, place some static tools, and then move a tool attached to the mouse. It isalso possible for the user to control two tools at the same time, the system givingto the second tool a symmetrical movement with respect to the rst one. The threelayers were simulated once, in the order we presented them, for each computationstep.Rather than showing the design of a complex object, which would hide the realintuitiveness of intermediate deformations, our set of results instead aim at show-ing that we obtain the eect we are looking for in a set of simple cases, for whichwe know how some real clay would behave. Results can be seen in Fig. 6, and vi-deo sequences are available on the web (http://www-imagis.imag.fr/Publications/2003/DC03). To be able to create complex objects, we will also need to be able4.3. Ecient use of information on the surfaceThe ray casting technique would be quite expensive if we had to do this work ateach time step. In practice, we can often keep information about the location wherethe closest cell can be found. We will only seek this closest cell between two z values,znear, and zfar, which are indices of cells in the row.When we nd the index z of the closest cell by casting a ray, we take this z for znearand zfar. This way, if there is no change in cells along the row between znear and thecamera, we will not have to compute that intersection at next time step. And we havesome events that change the values of znear and zfar.First, if the density value of a cell on the same row, closer to the camera than znear,has its value rise above the isovalue, we update the value of znear and zfar so that theymatch the z of this changed cell. In fact, we just found the new closest cell along therow. If the value in a cell located between z and z reaches the threshold, we only366 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369to use several tools at the same time. Improvements of this method, including han-dling of an arbitrary number of tools are presented in a Eurographics 04 short pa-per [10].5.1. BendingThe rst three examples illustrate plastic deformations, where the user tries tobend or twist a part of the sculpture. We choose to use a bar of clay for this example.In the rst case, we simply put a rst tool (on the left) in the contact of the clay,which will be used as a support to bend the bar. Then we move a second tool up-wards, which pushes the clay and thus bends the bar.In this rst example, the tools motion is a simple translation, but the user can userotating tools to obtain other kinds of deformations. In the second example, the userrotates his two tools in opposite directions to obtain the desired deformation for thebar. In the last example, the rotation of the two tools is used to twist the object (thesection of the bar is a square, in order to be able to see the twist).Fig. 6. Examples of deformations of a bar obtained with our system. See section 5 for details.5.2. HolesOur system allows us to dig holes in the clay. We take a thin layer of clay, and wex the four corners of the layer (we could instead have used four tools behind theobject as supports). Then we push our tool towards the clay. At rst the tool createsa small fold and begins to deform the piece of clay. But soon the tool goes throughthe clay, creating a hole (the last images of the hole sequences are taken from theopposite side).We can adjust the diculty of digging in the object by adjusting the uidity of theclay. For example, if the user wants to dig a hole in a thick object, as seen in the nextexample, he should use a more uid clay. This way, digging a hole without deformingthe object too much becomes possible. One can see that a bump behind the block iscreated when the tool exits the object. This is a normal consequence of volume con-servation, and similar to what could be produced with real clay.The highly symmetric pattern we obtain in these examples comes from the factthat we hold the four corners of the layers. It is not a consequence of the choiceof a near-Manhattan distance in our simulation scheme, and we would get very sim-ilar results with any other distances (and would give the exact same result if we usedpropagation among the 26 closest neighbors).5.3. Folds and printsThis is a very common behavior of our virtual clay: as soon as we move a tooltowards the clay, the clay, pushed by the tool, creates folds. This can be seen inour next example, where we use a sphere of clay xed in its center. For the last test,we used a tool with a more complex shape, to show that our model can make printsof any shape, simply by pressing a tool against the clay. Once again, to make printsmore easily, the user uses a uid behavior for the clay (see Fig. 7).G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 367Fig. 7. Holes, folds, and prints obtained with the virtual clay model.6. ConclusionReferences368 G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369[1] H. Arata, Y. Takai, N.K. Takai, T. Yamamoto, Free-form shape modeling by 3d cellular automata,in: International Conference on Shape Modeling and Applications, 1999, pp. 242247.[2] A. Brentzen, Octree-based volume sculpting, Presented at IEEE Visualization 98, 1998. Availablefrom: .[3] J.-R. Bill, S.K. Lodha, Sculpting polygonal models using virtual tools, in: Graphics Interface95,Quebec, Canada, May 1995, pp. 272278.[4] J. Bloomenthal, C. Bajaj, J. Blinn, M.-P. Cani-Gascuel, A. Rockwood, B. Wyvill, G. Wyvill,Introduction to Implicit Surfaces, Morgan Kaufman, California, 1997.[5] M.-P. Cani, M. Desbrun, Animation of deformable models using implicit surfaces, IEEE Trans.Visual. Comput. Graph. 3 (1) (1997) 3950.[6] S. Capell, S. Green, B. Curless, T. Duchamp, Z. Popovic, A multiresolution framework for dynamicdeformations, in: ACM SIGGRAPH Symposium on Computer Animation, July 2002, pp. 4148.We have described a real-time virtual clay model which can both be sculpted, as inprevious work, by adding and removing material, and deformed through the inter-action with rigid tools. Among the real-clay features, the ability to apply these defor-mations is essential, since it enables the artist to create complex shapes in a simpleconguration, and then deform them to a more intricate posture, while preservingthe volume and the relative lengths of dierent regions.Our deformations, both large- and small-scale, mimic the eects of tools on realclay (i.e., a plastic material with a constant mass and some surface tension). There-fore it is easy to achieve such usual behaviors as local folds, footprints, and large-scale bending when a thin part, held at one extremity, is pushed.Although inspired by physical properties of real material, our model is not trulyphysically based. We believe that the ability to exhibit the main characteristics ofreal clay at very low computational cost (and hence in real-time) is sucient to makethe user recover the feeling he gets by interacting with real dough or clay.Our future work will focus on new ways of specifying user interaction, and pro-viding some force feedback, another essential element for the user to recover the ges-tures he uses in real life.5.4. PerformancesComputing a framerate for our system is quite dicult, since it is heavily relatedto the users actions. The previous examples were sculpted on an Athlon 1.5 GHz,512 MHz or RAM, on a 32 32 32 grid. We managed to get about 50 simulationsteps/s, rendering half of them.We also used an older computer, a Pentium III 500 MHz which provided interac-tive response, even though the framerate was limited by the lack of graphic acceler-ation to about 1015 frames/s. Memory seems to have quite a large inuence onperformance.G. Dewaele, M.-P. Cani / Graphical Models 66 (2004) 352369 369[7] Y.-H. Chai, G.R. Luecke, J.C. Edwards, Virtual clay modeling using the isu exoskeleton, in:Proceedings of VRAIS98, March 1998.[8] G. Debunne, M. Desbrun, M-P. Cani, A.H. Barr, Dynamic real-time deformations using space &time adaptive sampling, in: Proceedings of ACM SIGGRAPH 2001, Computer Graphics Proceed-ings, Annual Conference Series, August 2001, pp. 3136.[9] G. Dewaele, M.-P. Cani, Interactive global and local deformations for virtual clay, in: PacicGraphics 2003, 2003.[10] G. Dewaele, M.-P. Cani, Virtual clay for direct hand manipulation, in: Eurographics 2004, 2004.[11] S. Druon, A. Crosnier, L. Brigandat, Ecient cellular automata for 2d/3d free-form modeling.WSCG, 11, February 2003.[12] E. Ferley, M.-P. Cani, J.-D. Gascuel, Practical volumetric sculpting, Visual Comput. 16 (8) (2000)469480, A preliminary version of this paper appeared in Implicit Surfaces99, Bordeaux, France,September 1999.[13] E. Ferley, M.-P. Cani, J.-D. Gascuel, Resolution adaptive volume sculpting, Graph. Models 63(March) (2002) 459478, Special Issue on Volume Modelling.[14] T.A. Galyean, J.F. Hughes, Sculpting: an interactive volumetric modeling technique, in: Proceedingsof SIGGRAPH91 (Las Vegas, Nevada, July 1991), Comput. Graph. 25 (4) (1991) 267274.[15] E. Grinspun, P. Krysl, P. Schroder, Charms: a simple framework for adaptive simulation, in:Proceedings of ACM SIGGRAPH 2002, ACM Trans. Graph. 21 (3) (2002) 281290.[16] F. Dachille IX, J. El-Sana, H. Qin, A. Kaufman, Haptic sculpting of dynamic surfaces, in: 1999 ACMSymposium on Interactive 3D Graphics, April 1999, pp. 103110. ISBN 1-58113-082-1.[17] D.L. James, D.K. Pai, Artdefoaccurate real time deformable objects, in: Proceedings ofSIGGRAPH 99, Computer Graphics Proceedings, Annual Conference Series, Los Angeles,California, August 1999, pp. 6572. ACM SIGGRAPH, Addison Wesley, Longman.[18] E.K.-Y. Jeng, Z. Xiang, Moving cursor plane for interactive sculpting, ACM Trans. Graph. 15 (3)(1996) 211222.[19] K.T. McDonnell, H. Qin, R.A. Wlodarczyk, Virtual clay: a real-time sculpting system with haptictoolkits, in: 2001 ACM Symposium on Interactive 3D Graphics, March 2001, pp. 179190. ISBN 1-58113-292-1.[20] B. Naylor. Sculpt: an interactive solid modeling tool, in: Proceedings of Graphics Interface90, 1990,pp. 138148.[21] K. Onoue, T. Nishita, Virtal sandbox, in: Pacic Graphics 2003, 2003, pp. 252259.[22] R.N. Perry, S.F. Frisken, Kizamu: a system for sculpting digital characters, in: Proceedings ofSIGGRAPH 2001, August 2001, pp. 4756. ISBN 1-58113-292-1.[23] A. Raviv, G. Elber, Three-dimensional freeform sculpting via zero sets of scalar trivariate functions.Comput. Aided Des. 32 (89) (2000) 513526. ISSN 0010-4485, an early version of this paperappeared in the Proceedings of the Fifth Symposium on Solid Modeling and Applications, 1999, pp.246257.[24] J. Stam, Stable uids, in: Proceedings of SIGGRAPH 99, Computer Graphics Proceedings, AnnualConference Series, August 1999, pp. 121128.[25] J. Stam, A simple uid solver based on the t, J. Graph. Tools 6 (2) (2001) 4352.[26] D. Terzopoulos, K. Fleischer, Modeling inelastic deformations: viscoelasticity, plasticity, fracture, in:Proceedings of SIGGRAPH88 (Atlanta), Comput. Graph. 22 (4) (1988) 269278.[27] D. Terzopoulos, J. Platt, K. Fleischer, Heating and melting deformable models (from goop to glop),in: Proceedings of Graphic Interface89, 1989, pp. 219226.[28] D. Terzopoulos, H. Qin, Dynamic nurbs with geometric constraints for interactive sculpting, ACMTrans. Graph. 13 (2) (1994) 103136.[29] D. Tonnesen, Modeling liquids and solids using thermal particles, in: Graphics Interface91, Calgary,AL, June 1991, pp. 255262.[30] T.I. Vassilev, Interactive sculpting with deformable nonuniform b-splines, Comput. Graph. Forum 16(4) (1997) 191199.[31] S.W. Wang, A.E. Kaufman, Volume sculpting, in: 1995 Symposium on Interactive 3D Graphics,April 1995, pp. 151156. ISBN 0-89791-736-7.Interactive global and local deformations for virtual clayIntroductionRelated workOverviewOur clay modelVolumetric representationDeforming virtual claySimulation of the virtual clayLarge-scale displacementsCombining tools and static regionsRotating toolsMoving matterChanging the behavior of clayMass-conservation layerPrinciplesInteraction with toolsImplementation issuesSurface tensionReal-time renderingOff-line renderingFast rendering during interactionEfficient use of information on the surfaceResultsBendingHolesFolds and printsPerformancesConclusionReferences

Recommended

View more >