volume sculpting: intuitive, interactive 3d shape …jab/vision.pdf · volume sculpting: intuitive,...

8

Click here to load reader

Upload: vuongdieu

Post on 01-Jul-2018

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

VolumeSculpting:Intuitive, Interactive3D ShapeModelling

AndreasBærentzen

May 15,2001

Abstract

A systemfor interactive modellingof 3D shapeson acomputeris presented.Thesystemis intuitive andhasa flat learningcurve. It is especiallywell suitedto thecreationof organicshapesandshapesof complex topol-ogy. The interactionis simple; the usercaneitheraddnew shapefeaturesor smoothanddeformexisting fea-tures.

1 Introduction

Interactive modelling of 3D shapeson a computershouldbeassimpleandintuitiveasdoodling2D shapesusingpencilandpaper. Simpler, in fact,sinceonacom-puter changescan always be undone,and the user ismorefreeto exploreandexperiment.

Thefactthatsimpleandintuitive3D shapemodellingis not quite “here” yet, we attribute to the fact that thepresentsystemsfor modelling(or sculpting)3D objectsarebasedonshaperepresentationswhich imposeunde-sirableconstraintson boththeuserinterfaceandon therangeof shapesthatarepossible.

In thispaper, wepresentanintuitivesculptingsystemthatis beingdevelopedat IMM. Thesystemis basedonthevolumetricrepresentationratherthanthetraditionalsurfaceorientedrepresentations.Thevolumetricrepre-sentationandvolumevisualizationarenormally asso-ciatedwith medicaldataandvisualizationbut the vol-umetricrepresentationis alsovery well suitedto solidmodelling.Thereareseveralreasonsfor this:

First of all, in volume graphics,operationswhichchangethe genus(i.e. changethe numberof holes)ofthesolidaretrivially supported.

Likewiseit is easyto supportmanipulationsthatmaydivide a model into separateparts. This is notewor-thy, becausein surfacebasedrepresentations,keeping

track of topology increasesthe complexity of the sys-tem.Thatis whysomesystems,likefor instance,there-cent,gesturebasedandveryintuitivesystem,Teddy[1],supportsonly shapesthatcanbedeformedto a sphere.

Anothersalientpointaboutvolumegraphicsis thatitseemsto lend itself quitewell to thesculptingof com-plex andorganicshapes.

Finally, two technologieshave provento bevery ef-fective in thecontext of volumegraphics:

� ConstructiveSolidGeometry(CSG).

� Level Settechniques[2]

CSGis a paradigmthat hasbeenusedfor many yearsin the context of solid modelling. Intuitively, CSGisaboutaddingandsubtractingshapesfrom othershapes.For instancetheusermayaddor subtractaspherefromthesolid he is working on. CSGis easilyimplementedin thecontext of volumegraphics.

Level settechniquesarevery useful for both globaland local deformationsof shapes. In the sculptingsystemdiscussedin this paper, level set techniqueshave beenusedto implementlocal smoothing,globalsmoothing,toolsfor addingandremoving material&c.Level set techniquesalso meshwell with the volumerepresentation.

1.1 Outline

Thenext sectionis anintroductionto thevolumerepre-sentation.Section3 is aboutvolumetricCSGandSec-tion 4 is aboutdeformativetoolsusingthelevel settech-niques.Section5 is abouttheactualuserinteraction.

In the threefinal sections,we discusssomemodelscreatedwith thesystem,thesoftwareandhardwareplat-forms,andfinally someconclusionsaredrawn togetherwith suggestionsfor furtherreading.

1

Page 2: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

2 The Volume Representation

Perhapsthesimplestwayto understandthevolumerep-resentationis that a volume is a stack of imagesasshown in Figure1. Eachimagecorrespondsto a singlesliceof therepresentedobject.In thevolumerepresen-

Image = Volume slice

Figure1: A volumeseenasa stackof images.

tation,thepixelsarecalledvoxels. Justlike a pixel is asmallsquarea voxel canbeseenasa smallbox. Thus,thestackof voxel imagesformsa3D arrayof boxesthatis calleda volume.

Accordingto a slightly differentoutlook,we canseea voxel asa point in 3D space(just like we canseeapixel asa point in a 2D space).Now, thevoxelsaretheverticesof a3D lattice(asshown in Figure2.

Voxelsarecharacterizedby their positionandanas-sociatedvalue. Whenthevolumerepresentationis usedfor solid modelling it seemsreasonablethat the voxelvalueshouldbe a binary variableindicating the pres-enceor absenceof matterin the immediatevicinity ofthevoxel.

However, this representationsuffers from a problemknown as aliasing. Aliasing turnsup many placesincomputergraphics. Probablythe simplestexampleisthatin two–colourcomputergraphicsastraightline be-comesajaggedsequenceof little blacksquares(pixels).To amelioratethe problem,we useantialiasingwhichusuallymeansmakingthe line a little fuzzy. The lineis approximatedusingpixelsof variousshadesof graydepending(for instance)onhow closetheline is to theircentres.

A similar solution is usedin volume graphics. In-stead of storing only binary values, voxels contain

Figure2: A volumeseenasa 3D latticeof voxels

scalarvaluesthataresampledfrom a functionwhich issomtimescalledacharacteristicfunction

���������.

Now, theobviousquestionis: How canthecharacter-istic function,

�, representa solid? The answeris that

thesurface(boundary)of thesolidshouldbeembeddedasan iso–surface, saytheiso–surfacecorrespondingtothevalue0. In that case,andif we usetheconventionthatthesignis negativeon theinterior:

���� ������impliesthat

is on theinterior sideof theboundary.

���� ������that

is on theboundary, and,finally,

���� ������that

is outsidetheboundary.

Normally, if � � � ���where

�is someconstant,we

recordonly whetherwe areinsideor outside(basically,thesignof

�) andnot thevalueof

�. This makesmost

of thealgorithmsfaster, andenableamorecompactrep-resentationof thesolid.

Theregion wherewe storetheactualvalueof�

, i.e.� ��� �������� �� �!�#" is calledthetransitionregion.The schemeis illustrated in 2D in Figure 3. The

black region is interior, the white region exterior, andthefuzzygrayregion is thetransitionregion.

2

Page 3: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

Figure 3: A slice of a volume. The grid is the voxellattice.Theiso–surface(iso–curvein 2D) is shown asacurve.

2.1 Voxelization and reconstruction

Theprocessof generatingvolumedatafrom a differentrepresentationis known asvoxelization. Voxelizationof solidsamountsto thesamplingof theircharacteristicfunction.

A typical exampleof a solid is thesphere.Thechar-acteristicfunctionof aspherewith centre$�% andradius& mightbeandthedistancefunctionis

'�( $�)�*,+-+ $/./$�%0+-+1. & (1)

It is clearthat'�( $�)�*32 correspondsto theperipheryof

thesphere.If we voxelize(i.e. sample)a characteristicfunction'atareasonableresolution,it is possibleto reconstruct'by interpolatingin the volume. Most often simple

linearinterpolationis used.Reconstructionof thevalueof thecharacteristicfunctionatanarbitrarypoint is fre-quentlynecessary– especiallyduringrendering.

2.2 Rendering

Theart of generatingimagesfrom volumesis know asvolume visualization. The two most important tech-

niquesfor volumevisualizationareiso–surfacepolygo-nizationandvolumerenderingby ray casting.Perhapsthebestknown exampleof the former techniqueis theMarchingCubesalgorithm[3].

In the interactive programdiscussedbelow, a differ-enttechniqueknownaspointrenderingis used.A densecloud of points on the iso–surfaceof the representedsolid areestimatedon the basisof the transitionvox-els, andthesepointsarerenderedusingOpenGL.Thepointsarerenderedso largethatno holesappear. Thisverysimplemethodis fasterthanthetraditionalvolumerenderingtechniques,andyieldsanacceptableresultforinteractivepurposes.

The higher quality imagesin this paperwere ren-deredusingraycasting.

3 CSG Operations

The simplest manipulationof a volume consistsofchangingthe value of a single voxel. In principle, itis possibleto manipulatevolumesin that way, but itrarelymakessense.In general,wechangemany voxelsat a time.

Assumethat we have voxelized a solid A. A sim-ple manipulationoperationwould beto voxelizea newsolid B andcombinethe voxels of the new solid withtheold. This couldbedoneby superimposingthe twovolumesandfor eachvoxel locationcombinethevoxels465 and 467 usingsomesimpleoperation.

Let us call the resultingvolumeC. It turnsout thatwecanuse 468 *�9;:-< ( 4 5 = 4 7 ) (2)

on all voxels to generatethe union of the solids. Thisoperationcanbe explainedby the observation that theshortestdistanceto theunionof two solidsis themini-mumof theshortestdistanceto either.

In fact thereis oftenno reasonwhy the tool solid Bshouldbe voxelized,sincethe samplingof thecharac-teristic function can be integratedinto the CSG oper-ation. Pseudocodefor the volumetricCSGunion of avolumeandasolidrepresentedby acharacteristicfunc-tion is shown below in Figure4. Intersectionanddiffer-encearealsopossible.For instance9?>1@ is oftenusedto computethe intersection.Unfortunately, CSGoper-ationsusingmin andmaxintroducessharpedgesin theresultingsolid. Sharpedgesareproblematicin volumegraphics,sincein generaltheboundarysurfacesof ge-ometricsolidsshouldbe curvaturelimited to ensurea

3

Page 4: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

a b c

Figure5: CSGoperation

CSGunion(Volumevol, CharacteristicFunf)Afor all( i,j,k in Vol)

Vol[i,j,k] = min(Vol[i,j,k], f(i,j,k));BFigure4: CSGunionof volumeandcharacteristicfunc-tion

goodreconstruction.To overcomethis problem,blend-ing is addedto theCSGoperations.

Theresultof aCSGunionoperationis shown in Fig-ure 6 and a 2D diagramof the operationis shown inFigure5.

4 Deformative Operations

The shapesthat can be createdusingonly volumetricCSG are ratherlimited. The resultingshapeslook toregularanddonot exploit thefactthatvolumegraphicsis verysuitablefor organicshapes.

The remedyis to implementdeformative methods,andagoodwayto dothis is throughLevelSetmethods.Basically, a level setis thesamethingasaniso–surface(discussedpreviously in Section2). Thecentralideaisto deformthe iso–surfaceby changingits embedding,i.e. thevoxelsin thevolume.

Much hasbeenwritten aboutthe level setapproach,andit would carry to far to repeateven thebasicalgo-rithm here1. Insteadaslightly simplifiedexplanationof

1However, level set techniques are a very interest-ing field, and the interested reader is referred to [2] orhttp://www.math.berkeley.edu/ sethian/

Figure6: Locusof blendingsphere

the deformationtechniquewill be given in the follow-ing.

First of all, thedeformationis surfaceoriented.Theboundarysurfaceof the solid is pushedin the normaldirection.To determinehow muchthesurfaceis pushedwe needa forcefunction. Typically, theforcefunction,say C , is definedin 3D, i.e. CEDGF�H�IJF but it is onlyevaluatedontheboundarysurface.For agivenpointonthe boundary, the valueof the force function indicateshow muchthe surfaceshouldbe pushedin the normaldirection.

For all voxels in the transition region, the closestboundarypointis found,andthevalueof theforcefunc-tion is evaluated.The voxel valueis thenchangedde-pendingon the force. Say the voxel is K6LNMPO , and theclosestboundarypoint is QSRPTVUXW . Thenew valueis sim-

4

Page 5: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

ply theold valueminusthevalueof theforcefunction:

Y6ZN[P\ � Y6ZN[P\ �^] ��_S`PaVbdce� (3)

In our examples,values�E�

correspondto insideandvalues

�E�to outside. Hence,if the force function is

positive, this operationpushesthe boundaryoutward.Similarly if theforceis negative,theobjectshrinks.Astheobjectexpandsor shrinks,new voxelsareaddedtothetransitionregionasneeded.

The value of the force function shouldnot be toolarge. In generalthe valueof ] shouldnot be largerthanthedistancebetweentwo adjacentvoxels.

Figure 7: Illustration of deformationscheme: Nor-malsscaledby themagnitudeof theforcefunction(topleft), Lines indicateclosestboundarypointsfrom vox-elswheretheforcefunctionis sampled(top right). Theiso–surfaceis changed(bottom).

It is very easyto designa force function for creat-ing small bumps,but moresophisticateddeformationsarealsopossible.For instance,if the curvatureof thesurfaceis used,geometricsmoothingof the surfaceispossible.

It is importantto notethatthedeformationsmayresutin topologicalchanges.For instance,a negative forcefunction canbe usedto make a dent. Repeatedappli-cationcanbe usedto createa hole throughthe model.Sincethesurfaceis notexplicitly representedbut existsonly asaniso–surfaceof thevolume,thisis notproblemandsuchsituationsaretrivially handled.

The implementedtools and their respective forcefunctionsaresummarizedbelow:

� Add material(positive forcefunction)

� Removematerial(negativeforcefunction)

� Smooth(Forcedependingon curvature)

� Un–smooth(Forcedependingon curvature. Signreversed.)

� Dilate. (Constantforce,inflatesobject.)

5 Interaction

Manipulationshouldbebothsimpleandpowerful. Bypowerful, we meanthat theusershouldbeableto con-trol theplacementandorientationof thetool completelyandprecisely. To retainsimplicity, we have madethesystemmodal. In onemode,the navigation mode,theuser mainly controls the object. In the other modewhich is intendedfor CSG,the userhasmoreprecisecontrolover theCSGtool.

Initially, in navigationmode,theuseris ableto pan,rotateandzoomin on the objecthe or sheis workingon. Whenthe userhasfound an appropriateangletowork from, a numberof deformationtools and CSGtoolsmaybeapplied.

TheCSGtoolscube,cylinder, tetrahedronandspheremaybeselecteddirectly by theuser, but ellipsoidsandconvex polyhedrain generalarealsosupportedby thesoftware framework. Deformationtools include a lo-cal smoothingtool anda mattertool that canbe usedto createsmall bumpsor dents. Thereis alsoa globalsmoothingtool, anda tool for dilating theshape.

In navigation mode,the userplacesthe tool on thesurfaceof the object. This is donesimply by movingthe mouseover the desiredlocationon the objectsur-face. The initial position of the tool is found by un-projectingthescreenspacex,y,zpositionof thelocator.The x,y positionis simply the mousecoordinates,andthecorrespondingz valueis obtainedfrom thez–buffer.Theinitial orientationof thetool is eithersetto thesur-faceorientationat thatpoint or to the directiontowardtheeyepoint.

Oncethetool is placed,theusersimplypressesabut-ton to activate. Hencea point anda click is all it takesto doaCSGoperation,to smoothabit of thevolumeorto adda smallbump. If thetool is a CSGtool, theusercanlock theview (switchingto manipulationmode)androtateor translatethetool to a morepreciselocationifdesired.

5

Page 6: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

Whenswitchingto manipulationmode,theinitial po-sition and orientationof the tool are usedto defineacoordinatesystem,the tool coordinatesystem– TCS,for furthermanipulationof the tool. Theusercannowperformthefollowing operations.

� Rotation.Thetool is rotatedusingaseparatetrack-ball. It is alwaysrotatedaboutits own center.

� XY Translation.Thetool canbemovedaroundintheXY planeof thetool coordinatesystem.

� Z Translation. Again in the TCS. This motionis useful for boring holesor to extendcylindricalshapes.

The describedoperationsare all performedusing themousein thegraphicswindow. A separatecontrolpanelallowstheuserto setthesizeandtypeof thetool andtochoosewhetherto addor subtractthetool shape.

6 Models

Somemodelscreatedusing the systemare shown inFigure8. A maskmodel is shown togetherwith threeheadmodels.Thesimplestof these,head1, is, in fact,thestartingpoint for head2 andhead3.

Head1 is sculptedusingonly CSGoperations.Head2 is createdfrom head1throughextensiveuseof thede-formative tools for adding,subtractingandsmoothingmaterial. The fat appearanceof head3 wascreatedbydilating head2 andsculptingon from there.Thebeardon themaskmodelwascreatedusingnegativesmooth-ing.

7 Implementation

The system has been implemented in C++ usingOpenGL for graphicsand FLTK for the user inter-face.We have testedthesystemon PCsequippedwithGeforce2GTS graphicscardsrunningeitherLinux orWindows.

In addition,a slightly modifiedversionrunson a 16processorSGI Onyx 2 with 3 InfiniteReality2Egraph-ics boardsin the UNI-C Virtual Reality Center. TheOnyx is connectedto a 6.5 by 2.5 mf stereodisplay,andit is possibleto sculptin stereo.Becauseeachpro-cessor(MIPSR10000)runsatonly 195MHz, thecom-putationallyintensivemanipulationoperationsarequiteslow onthisarchitecture.Hence,theCSGmanipulation

operationshave beenparallelizedusingthepthreadsli-brary.

8 Conclusions

A volume sculptingsystemhasbeenpresented.Thesystemallowstheuserto editavolumetricsolidby con-structive anddeformativeoperations.Theseoperationsareprovided througha simpleandintuitive userinter-face.

The systemruns on an ordinary PC running eitherLinux or Windows. This may be surprisingsince,un-til recently, volumevisualizationandvolumegraphicsrequiredhardwareoutsidethe rangeof pc–buyers;butit seemsthat the swift advancesin PC technologyandgraphicscardshas leveragedvolume graphicsin thepastfew years.This mayalsoexplain why the interestin interactive volumesculptingseemsto be increasingcurrently.

8.1 Further Reading

Thispaperhasonly grazedthesurfaceof volumegraph-ics. An in–depthpublicationaboutthepresentedsculpt-ingsystemhasnotyetbeenwritten,but thereareanum-berof interestingpublications:

� Recentsculptingsystems:[4, 5, 6].

� Not–sorecentsculptingsystems:[7, 8, 9].

Thereis alsoa recentbookentitled‘VolumeGraphics’[10] which is a collectionfrom the 1999workshoponvolumegraphics.Finally, thereis a singlecommercial(extremelyexpensive)sculptingsystem:

http://www.sensable.com/freeform/

References

[1] Takeo Igarashi,SatoshiMatsuoka,andHidehikoTanaka. Teddy: A sketching interface for 3dfreeformdesign. In Proceedingsof SIGGRAPH1999.

[2] JamesA. Sethian. Level SetMethodsand FastMarching Methods. CambridgeMonographsonApplied and ComputationalMathematics.Cam-bridgeUniversityPress,secondedition,1999.

6

Page 7: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

Figure8: Maskmodel(top left), head1 (top right), head2 (bottomleft) andhead3 (bottomright)

7

Page 8: Volume Sculpting: Intuitive, Interactive 3D Shape …jab/vision.pdf · Volume Sculpting: Intuitive, Interactive 3D Shape Modelling ... 1.1 Outline The next section is an introduction

[3] W. E.Lorensen& H. E.Cline. Marchingcubes:Ahighresolution3dsurfaceconstructionalgorithm.ACM ComputerGraphics, July 1987.

[4] AndreasBærentzen.Octree–basedvolumesculpt-ing. In CraigM. WittenbrinkandAmitabhVarsh-ney, editors,LBHT Proceedingsof IEEE Visual-ization’98, October1998.

[5] Eric Ferley, Marie-Paule Cani, and Jean-Dominique Gascuel. Practical volumetricsculpting. the Visual Computer, 16(8):211–221,December2000.

[6] Alon Raviv and Gershon Elber. Three–dimensional freeform sculpting via zero setsof scalar trivariate functions. Computer–AidedDesing, 32:513–526,August2000.

[7] Sidney Wang and Arie E. Kaufman. Volumesculpting. In 1995 Symposiumon InteractiveGraphics. ACM SIGGRAPH,1995.

[8] Tinsley A. GalyeanandJohnF. Hughes. Sculpt-ing: An interactive volumetric modeling tech-nique. ACM ComputerGraphics, 25(4), July1991.

[9] Alan E. Richardson, Robert P. Burton, andWilliam A. Barrett. A volumetric systemfor interactive three-dimensionaldesign. Jour-nal of Imaging Technology, 17(4):188–194,Au-gust/September1991.

[10] Min Chen,Arie E. Kaufman,andRoni Yagel,ed-itors. VolumeGraphics. Springer, 2000.

8