Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
EECS487:Interactive
ComputerGraphicsLecture36:• Polygonalmeshsimplification
TheModeling-RenderingParadigm
Modeler:
Modelingcomplexshapes
• noequationforachair,face,etc.
• instead,achievecomplexityusing
simplepieces
• polygons,parametricsurfaces,or
implicitsurfaces
• witharbitraryprecision,inprinciple
Renderer:
scenegraph
Vertexdata
Fixedfunction
transformand
lightingVertexshader
Clip,homogeneous
divideandviewport
Texturestages Fragmentshader
Rasterize
Fragmentmerging:
stencil,depth
3DGeometryRepresentations
Points
• 2D:rangeimage
• 3D:pointcloud
Surfaces
• Polygonalmesh
• Parametricsurfaces
• Subdivisionsurfaces• Implicitsurfaces
Solids
• ConstructiveSolidGeometry
• Voxels
Procedural
• Particlesystem
• Spring-masssystem
• Fractals
Funkhouser
Representdifferentkindsofinformation:
pointdata,surfacedata,volumetricdata
2D:RangeImage
Imagewithdepthinformation
• acquiredfromrangescanner,incl.MicrosoftKinectand
GoogleTango
• notacomplete3Ddescription:doesnotinclude
partofobjectoccludedfromviewpoint
Rangeimage Tessellation Rangesurface
Funkhouser,Ramamoorthi
Curless
Cyberware
3D:PointCloud
Unstructuredsetof3D
pointsamples
Acquiredfromrangefinder
Disadvantage:
nostructuralinfo
• adjacency/connectivityhavetousee.g.,k-nearestneighborstocompute
Increasinglyhottopicin
graphics/visiontoday
Microscribe3D
Funkhouser,Ramamoorthi,Ohtake
Surfaces
Boundaryrepresentation(B-reps)
• sometimesweonlycareaboutthesurface,e.g.,when
renderingopaqueobjectsandperforminggeometric
computations
Chenney,Lozano
3Dsurface triangles
SolidModelingSomerepresentationsarebestthoughtofas
definingthespacefilled
• medicaldatawithinformationattachedtothespace
• transparentobjectswithinternalstructure
• takingcutsoutofanobject,“WhatwillIseeifIbreakthisobject?”
Chenney,Lozano
3Dvolume volumeelement
“voxel”
ChoosingaRepresentation
Efficiencyfordifferenttasks:
• creation/acquisition:byhand,procedurally,byfittingtomeasurements
• interaction/manipulation:simplification,
compression,localcontrolofshapefor
modeling,animation,etc.
• geometriccomputation:distance,intersection,
normalvectors,smoothnessandcontinuity,
abilitytoevaluatederivatives,curvature,
similaritycomparisons,indexing,search
• storageandtransmission:compactness
• rendering,e.g.,withhardwareaccelerator:
converttopolygon
Funkhouser,Chenney
AdvantagesofRepresentations
Manipulation:
• splineseasiestoriginally,butnow
manyalgorithmsforpolygonmeshes
Acquisitionandmodeling:
• splines,CSGoriginallyusedformodeling
• butincreasinglycomplexmeshes,rangeimages,
andpointcloudacquiredfromrealworld
Simplicity:meshes
Efficienthardwarerendering:meshes
Ramamoorthi
WhatdoPeopleUse?
Trianglemeshesmostwidelyused
Subdivisionsurfacesusedalotinmovies
Splinepatchesusedbymodelingprograms
ConstructiveSolidGeometry(CSG)usedfor
modelingmachineparts
Volumedatausedinmedicalimaging
Rangeimagesusedinimage-basedrendering
Pointcloudsbecomingincreasinglyrelevant,
especiallywithcomputervision
Ramamoorthi
ComparisonofB-Reps
Funkhouser
Features Polygonal
Mesh
Implicit
Surface
Parametric
Surface
Subdivision
Surface
Accurate ✗ ✔ ✔ ✔
Compact ✗ ✔ ✔ ✔
Intuitive ✗ ✗ ✔ ✗
Local ✔ ✗ ✔ ✔
Affine ✔ ✔ ✔ ✔
Realobjects ✔ ✔ ✗ ✔
Continuity ✗ ✔ ✔ ✔
Parameterization ✗ ✗ ✔ ✗
Rendering ✔ ✗ ✔ ✔
Intersections ✗ ✔ ✗ ✗
Introductiontofivetopics:
1. howtodrawgoodlookingmeshes?
2. meshsimplification
3. levelofdetail
4. meshrepresentation
5. errorcheckingandmeshprocessing
PolygonalMesh
DelaunayTriangulationHowtocreatea“goodlooking”
trianglemeshfromasetofpoints?
• minimumverticesandtriangles
• fewer,largertriangles
• nosliver
AtriangulationisDelaunayifffor
eachedgethecircumcircleofan
adjacenttriangledoesnotcontaintheoppositevertex
Amongallpossibletriangulations,theDelaunay
triangulationmaximizesthesmallestangle
Rhymeswith“baloney”[Hart,Bischoff&Kobbelt]
DualMeshesandVoronoiDiagram
Thedualofameshexchangesitsfacesandvertices
• placenewverticesatcentroidoffaces
Edgesindualcrossoriginaledges
• atrightangles• atmidpoints
• (butmightnotactually“cross”
ifnewvertexisatoriginaledge)
DualofaDelaunayTriangulation
isaVoronoiDiagram
• aVoronoifacedenotesaregionclosertoagivenDelaunay(original)vertexthanto
anyotherDelaunayvertex
Hart,vanLaerhoven
MeshSimplification
Morepolygonsincreasesmodelaccuracy,but
requiresmorespaceandprocessing/renderingtime
• needforaccuracydependsontheapplication• gamevs.medicalimaging
• approximatesolutionsvs.finalsimulations
• screenresolutionorviewingdistance
maynotcallforaveryaccuratemodel
Acquisitionsystems(e.g.,3Dscanner)oftenproducehugemodels
• moredetailedthannecessary
• millionsofpolygonsperobjectarecommon
• billionsofpolygonsperobjectarestartingtohappen• 300millionfaces=3.7GBaftergzipcompression
Yu
MeshSimplification
Reducepolygoncount:
• lessstorage• fasterrendering• simplermanipulation
Simplificationalgorithms:
• vertexclustering• meshretiling
• meshdecimation
• meshoptimization
Funkhouser
Desiredproperties:
• generalityintypesofmesh
• efficiencyandscalability
• qualityofapproximation
• visual• geometric:topologicalmodifications
• controlofapproximationquality• continuousLoD• smoothtransitionsbetweenmodels
VertexClustering
Method:
• partitionspaceintocells• grids,spheres,octrees,...
• mergeallverticeswithinthesamecell
• triangleswithmultipleverticesinonecell
degenerateintolinesorpoints
Properties:
• generalandrobust• allowstopological
changes
• notbestquality
Hart,Funkhouser
MeshRetiling
Resamplemeshwith
“uniformlyspaced”
randomvertices:
• generaterandom
verticesonsurface
• spreadthemuniformly
usingdiffusion/repulsion
• triangulatevertices
Properties:
• slow
• blurssharpfeatures
Funkhouser,Turk
MeshDecimation
Simplificationalgorithm:
• eachoperationsimplifiesthemodelbyasmallamount
• applymanyoperationsinaniterative,greedyfashionto
graduallyreducecomplexityofmesh:1. measureerrorintroducedbypotentialdecimationoperations
2. placeoperationsinapriorityqueuesortedbyerror3. performoperationsinqueuesuccessively
4. aftereachoperation,re-evaluateerrormetrics
Typesofoperations:
• vertexremove
• edgecollapse• vertexcluster(virtualedgecollapse)
First,sometopologicalpropertiesofmeshes...
TP3,Funkhouser
bad
ManifoldSurface
LetMbeasurfacein3D
Misamanifoldiffaneighborhood
ofanypointpinMistopologically
equivalenttotheunitopendisk
(interiorofaunitcircle)
Topologicalequivalence(or
homeomorphism)allows
deformationthatdoesnotrip,
tear,orpokeholes
Onamanifoldsurface:
• everyedgeissharedbyexactly2faces• aroundeachvertexexistsaclosedloopoffaces
good
Hart,TP3
partof
manifold
surface
M’isamanifoldwithboundaryiffaneighborhoodofanypointpinM’ishomeomorphictoahalfdisk
Onamanifoldwithaboundary:
• edgesontheboundarybelongtoexactlyoneface
• aroundverticesontheboundarytheloopoffacesisopen
A3Dsurfacethatisamanifoldsurface
withoutboundaryisaclosedsurface
ManifoldswithBoundary
amanifoldsurface
withboundary
TP3
PiecewiseLinearManifolds
Closedmesh
Nodanglingfaces
Edgesonlyboundtwofaces
Watertight
• noholesinthesurface• noboundary• orientable
non-manifold
boundaryvertex
non-manifoldedge dangling
face
Hart,TP3
OrientableSurface
Orientablesurfacehas2sides,likeapieceofpaper
Byconvention,thenormalofa
closedorientablesurfacepoints“outwards”
TheMöbiusstripandKleinbottleare
non-orientablesurfaces:
TP3,EscherKarcher,Chu-Carroll,
VertexRemove
Hart,Funkhouser,Ramamoothi
Method
• removevertexandadjacentfaces
• fillholewithnewtriangles
(2lesstriangles)
Properties
• requiresmanifoldsurfacearoundvertex
• preserveslocaltopologicalstructure• filingholewellmaynotbeeasy
EdgeCollapse
Method
• mergetwoedgeverticesintoone
• deletetwodegeneratetriangles
Properties
• requiresmanifoldsurfacearoundvertex
• preserveslocaltopologicalstructure• allowssmoothtransition
Hart,Funkhouser
vertexsplit
edgecollapse
VirtualEdgeCollapse
A.k.a.vertex-paircontractionorvertexcluster
• joinspreviouslyunconnectedareas• allowstopologicalsimplification
• usuallylimitedtosmalldistance
toavoidO(N2)virtualedges• notbestquality
Hart,Manocha
Asurfaceissimplicialcomplexiff
• polygonsmeetonlyalongtheiredges
• edgesintersectonlyattheirendpoints
SimplicialComplexSurface
TP3
yes not
IterativeEdgeCollapse
Properties
• well-definedforanysimplicial
complexsurfaces
• induceshierarchyonthesurface:allowssmoothtransition(geomorph)
• currentlymostpopulartechnique
(standardfeatureinDirect3D)
Hart,Funkhouser,Watt00
ErrorMetricsforSimplification
Usedtorankedgesduringsimplification
• reflectsamountofgeometricerrorintroduced
• maindifferentiatingfeatureamongalgorithms
Mustaddresstwointerrelatedproblems
• whatisthebestcontractiontoperform?
• whatisthebestpositionv’forremainingvertex?
• canjustchooseoneoftheendpoints• butcanoftendobetterbyoptimizingpositionofv’
SeeTP3 §6.5fordetailsJ
Hart
LevelofDetail(LoD)Pyramid
Singleresolutionnotenough
• applicationcontextdictatesrequireddetail• contextvariesovertime(andspace)
Levelofdetail:
• replaceeachobjectinthescenegraphwithahierarchy
ofobjectsatdifferingresolutions
• choosethemodelappropriateforcurrentcontext:
collisiondetectionvs.rendering,frameratevs.quality
RTR,
Hodgins
DiscreteLoD
Givenamodel,buildasetofapproximations
• canbeproducedbyanysimplificationsystem
• atruntime,simplyselectwhichtorender
• fairlyefficient
• storagerequired< 2xoriginal• costofchanginglevelofdetailwhilerenderingnotsignificant
• imagepyramids(mip-maps)agoodexample
Inter-frameswitchingcauses“popping”
• cansmoothtransitionwithimageblending
• orgeometryblending(requirescontinuousLoD)
Supportedbyseveralscenegraphs:
• RenderMan,OpenInventor,IRISPerformer,...
Hart
ContinuousLoD
Needformulti-resolutionmeshes:
• toreduce“popping”whenswitchingmodels,
geometricmorphbetweentwoLoDs
• sometimescannotchooseasingleLOD,mayneeddifferent
amountsofdetailsonthesamesurface(seenextslide)
• progressivetransmission(detailincreasesovertime)
Funkhouser,Certainetal.
ProgressiveMeshing
Iterativelydecimateameshusingedgecollapse
Storetheinversevertexsplitforeachcollapse
Themostsimplifiedmesh(basemesh)and
vertexsplitrecordsformtheprogressivemesh:
M = M n � … � M 175 � … � M 1 � M 0
M n � … � M i � … � M 175 �… � M 1 � M 0 = M
� ecoln-1 ecoli ecol0
�
vspln-1 vspli-1 vpsl0
13,546 3478 500 152 150
Hoppe96,Manocha,Funkhouse
r
RatherthanafewdiscreteLODswehaveafullrange
• vertexsplitdoesnotrequiremuchstorage
• themeshesareflexibleandeasilyreversible
• requiresoriginalpositionstobekeptwitheachedgecollapse
Supportforselectiverefinement
• requiresmoreinfoonadjacentvertices
andfacesofeachcollapsededge
Cangeomorphsmoothly
betweenLODs
• minimizes“popping”
ProgressiveMeshing
Manocha,TP3
Commonlyusedforterraingeneration
TerrainclosetoviewerisshownwithagreaterLoD
Preserve:
• silhouette• specularhighlights
View-DependentSimplification
Manocha,Hoppe
cluster
Introductiontofivetopics:
1. howtodrawgoodlookingmeshes?
2. meshsimplification
3. levelofdetail
4. meshrepresentation
5. errorcheckingandmeshprocessing
PolygonalMesh
PolygonalMeshRepresentation
Howwouldyourepresentapolygonalmesh?
Threealternatives:
1. explicitmesh(facelist)
2. vertexlist3. edgelist
Importantproperties:
• efficienttraversaloftopology(fordrawing,e.g.)
• efficientuseofmemory(compactness)
• efficientupdates(UI,vertexremoval,computingper-
vertexnormals)
(x1, y1, z1) (x2, y2, z2)
(x3, y3, z3) (x4, y4, z4)
Extension:moretopologyinformation:inaddition
toalistofvertices,eachfacealso
• pointstoitsadjacentfaces• andforeachadjacentface,theindexofthesharededge
Especiallyconvenientforsubdivisionandmultiresolution
hierarchies
PolygonalMeshRepresentation
[Zorin,Bischoff&Kobbelt]
PolygonalMeshRepresentation
Adjacencyoperationsimportantinmesh
simplificationandmanyotherapplications:
• givenface,finditsvertices• givenvertex,findfacestouchingit• givenface,findneighboringfaces• givenvertex,findneighboringvertices• givenedge,findverticesandfacesittouches
Ramamoorthi
Explicitmeshor“polygonalsoup”model:
alistofpolygonalfaces
Example:P = {P1, P2, P3, …, Pn}� P1= ((x1, y1, z1), (x2, y2, z2), (x3, y3, z3)), � P2= ((x3, y3, z3), (x2, y2, z2), (x4, y4, z4))
Problems:
• sharedverticesareduplicated• notopologyinformation(e.g.,whichvertices
andedgesareshared),mustsearchthewhole
listtomodifyavertex
• roundofferrors:cracksandfailuretomatchvertices
PolygonalMeshRepresentation
Vertexlistor“indexedfaceset”:
Example:V = {(x1, y1, z1), (x2, y2, z2),�(x3, y3, z3), (x4, y4, z4)},
P1 = (v1, v2, v3), P2 = (v3, v2, v4)Characteristics:
• sharedverticesarestoredonlyonce• butstillnotopologyinformation:
findingsharededgesstillrequiresasearch
Extension:triangleneighborlist:
• vertexpointstoasingleneighboringtriangle• trianglepointstoitsthreeneighboringtriangles• canenumeratetrianglesaroundavertex
PolygonalMeshRepresentation
Marschner
Usedin
3dsmax,
X3DOBJ
fileformat
Edgelist:
Example:V = {(x1, y1, z1), (x2, y2, z2),�(x3, y3, z3), (x4, y4, z4)},
E1 = (v1, v2, P1, ø),E2 = (v2, v3, P1, P2),E3 = (v3, v1, P1, ø),�P1 = (E1, E2, E3), P2 = (E2, E4, E5)
Extension“wingededge”:
• eachedgepointsto:• twoendpointvertices
• twofacesthatshareedge
• fouredgesemanatingfromitsendpoints
• faces,verticescontainpointertooneedge
PolygonalMeshRepresentation
Marschner
Polygonmeshcanarriveinerror
duetohumanerrorsorscannerlimitations
Thingstocheck:
• everyvertexisanendpointtoatleasttwoedges
• everyedgeispartofatleastonepolygon• everypolygonisclosed• everypolygonhasatleastonesharededge
Otherchecks:
• vertexnormal
• normaltotheplane
• plane’simplicitfunction
• convexornot• holes?surfacewatertight?
PolygonMeshErrorChecking PolygonMeshProcessing
Topologicalfixups:fixholes,cracks,self-intersection
Podolak Borodin
Funkhouser
Notaverycompactrepresentation
• needsalotofflatelementstorepresent
smoothorhighlydetailedsurfaces
• accuracy:exactnessofrepresentationcanonlybeapproximatedbyincreasingthenumberofpolygons
• ifimageisenlarged,planarsurfacesagainbecomeobvious
Intersectiontest?Inside/outsidetest?
Hardtoedit
• creatingpolygonalobjectsisstraightforward…
thoughlaboriousandtedious
• howdoyoueditapolygonal-meshsurface?
• don’twanttomoveindividualvertices…
• difficulttodeformobject:aregionoflowcurvature,representedwithlow
polygoncount,cannotbedeformedintoahighcurvatureregion
• itismoreamachinerepresentationthanaconvenientuserrepresentation
TheProblemswithPolygons