300 likes | 442 Views
Computer Graphics SS 2014 Geometric Models - II. Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung. Object representation. In Computer Graphics we often have to test a polygon mesh against other primitives, e.g., rays Questions that arise are :
E N D
Computer Graphics SS 2014 Geometric Models - II Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung
Objectrepresentation • In Computer Graphics weoftenhavetotest a polygonmeshagainstother primitives, e.g., rays • Questionsthatariseare: • Does a rayintersectthesurface? • Whichtriangledoes a rayintersect? • Underwhich angle does a rayhit a surface?
Objectrepresentation • Ray-triangleintersection • Anypointp in the plane spannedby a trianglecanbeexpressedas p= p0+ 1(p1-p0)+ 2(p2-p0) = (1-1-2)p0 + 1p1 + 2p2 = 0p0 + 1p1 + 2p2 • As pis on theray (startpointpsanddirectiond):ps+ t d = p0 + 1(p1-p0)+ 2(p2-p0) • Requiressolutionof a 3x3 systemof linear equations • Inside/outsidecanbedeterminedfromi(seelater in course)
Objectrepresentation • The angle underwhich a rayhits an objectdepends on the „orientation“ oftheintersectionpoint; This isgivenbythesurface normal – theunitvectorbeingperpendiculartothelocaltangent plane
Objectrepresentation • Tangent plane • The tangent plane at point on a surface is the plane in ℝ3whichisspanned by the tangent vectors of curves on the surface passing through the point
Objectrepresentation • Howtodeterminesurfacenormalsofpolygonmodels • Per-polygon normalscanbecomputeddirectlybytakingintoaccounttheplanarityofpolygonsandorthogonalityof normal vectors • Per-vertex normalscanbecomputeddirectlyfromthesurfacerepresentation (seelaterforimplicit/explicit representations) • Can also becomputed for everyplanarface and averagedatthevertices (assuming a consistentorderingoffacevertices)
Objectrepresentation • In a polygonmodel, normalsarestored per vertex • Storedas additional vertexattributes • Interpolatedduringrenderingasanyother per-vertex attribute
Objectrepresentation • Sometimeswe deal withobjects, i.e. surfaces, whichhave a functionaldescription • Such a descriptioncanbeusedtoconstruct a polygonal representation • Itcan also beuseddirectly in a numberofapplications, e.g. findingintersectionwithrays • The algebraicrepresentationswediscussare • Implicitdescription • Parametricdescription
Continuoussurfaces • Parametricsurfaces • Defined via a mappingfromℝ2(theparameterdomain) toℝ3ie. coordinatesaredescribed via parametricequations 2 • Denotebythe partial derivatives ofxwrtuandv
Parametricsurfaces • Curves for some constant u or v are called u-curves and v-curves, respectively, or just coordinate curves
Parametricsurfaces • Parametricplane
Parametricsurfaces • Parametriccylinder
Parametricsurfaces • Parametricunitsphere Azimuth Zenith
Continuoussurfaces • Parametricsurfaces • The tangent plane at point is the plane in ℝ3whichisspanned by the tangent vectors of curves on the surface passing through the point • span the tangent plane and any tangent vector can be decomposed into a linear combination of • The unit vector normal to the tangent plane is
Continuoussurfaces • Normals of a parametricsurface • Parametric equations of a cylinder: • Normal: n
Continuoussurfaces • Intersecting a raywith a parametricsurface px+ t dx = x(u,v) py + t dy = y(u,v) pz+ t dz = z(u,v) →Yields 3 equations and 3 unknowns – just solveit! → Can becomplicatedfor non-simple x,yandz
Continuoussurfaces • Implicitdescription • Surface describedbythesetofpointsthatlie/don´tlie on thesurface {(x,y,z) ∈ V | f(x,y,z) = 0} V ∈ ℝ3, • Exampleunitsphere: • Cannotcomputesurfacepointsdirectly, but insertingpointcoordinatesyields „distance“ fromsurface
Continuoussurfaces • Implicit surface – a different view • Assumewehave a scalarvalueateverydomainpoint • Implicitsurfacerepresentsthesetof all pointsatwhichthevalueisc (thelevel-setsoriso-contours)
Continuoussurfaces • Implicitdescriptionofquadricsurfaces: Ax2 + By2 + Cz2 + Dxy+ Exz + Fyz + Gx + Hy + Iz + J = 0 Planes, spheres, cylinders, cones, ellipsoids, paraboloids etc. ellipsoid paraboloids hyperboloids
Continuoussurfaces • Ray-quadricsintersection • Substitutingrayequationp(t) = ps + tdintoquadricsequationyields a quadraticequationAqt2 +Bqt+Cqwith solutions
Continuoussurfaces • Ray-quadricsintersection • If the quadratic equation has two real roots, then the ray intersects the surface twice • If it has one real root of multiplicity two then the ray touches the surface once • If it has two complex roots (negative discriminant) then the ray misses the surface • If there are real roots, their signs should be tested, since they are at or behind the origin of the ray
Continuoussurfaces • Normal at a point on an implicitsurface • Forimplicitsurfacesthenormal directionata surfacepointpisgivenbythe (normalized) gradientatthispoint • The gradient of a function (f) gives a vector pointing in the direction in which the function is increasing the most in the vicinity of the point • The gradient is defined as
Continuoussurfaces • For a quadricsurfacethenormalata surfacepointpisgivenby
Continuoussurfaces • Example: sphere The vectorfromthecentertothepoint on thesphere
Objectrepresentation • Summary • Learnedwhat a polygonal representationis • Consistsofpolygons, whichconsistsofverticesandedges • Normals determinetheorientationofsurfacepoints • Normals canbeapproximated on thepolygonmesh • Discussed different surfacerepresentations • Learnedhowtointersect a raywith such objects • Learnedhowtodirectlycomputenormalsfrom such representations
Objectrepresentation • Research topics • Geometrycompression 230MB vs. 10GB
Objectrepresentation • Research topics • Modellingbysubdivision
Objectrepresentation • Research topics • Remeshing
Objectrepresentation • Research topics • Surface (mesh) deformation
Objectrepresentation • Research topics • Modelling with alternative patches