350 likes | 554 Vues
Advanced Computer Graphics Computer Animation. Implicit Surfaces Spring 2002 Professor Brogan. Many slides from Brian Wyvill’s online materials at U. Calgary. Papers for Tuesday. Spacetime Constraints, Witkin and Kass Siggraph Deep-water Animation and Rendering
E N D
Advanced Computer GraphicsComputer Animation Implicit Surfaces Spring 2002 Professor Brogan Many slides from Brian Wyvill’s online materials at U. Calgary
Papers for Tuesday • Spacetime Constraints, Witkin and Kass • Siggraph • Deep-water Animation and Rendering • Gamasutra.com, Sept 26, 2001
Implicit Surfaces • Surfaces defined by points that satisfy • f(P) = 0 Implicit Function • Example, a circle • Parametric • x=r cos(a) • y=r sin(a) • Implicit • x2 + y2 + r2 = 0
Implicit Surface Modeling • Useful for modeling natural and smooth/organic synthetic phenomena • Living forms, liquids, clouds • Each primitive is represented by a skeletal element which contributes in defining a scalar field • Every point in space is assigned a scalar value equal to shortest distance to a skeletal element
Implicit Surface Modeling • Simplest skeletal element is a point • A (distance) contour of that point defines the (surface of the) model • Ex: two points approach and their contours blend
Blending Skeletal Elements • Define a simple surface as: • A central point, C • A radius of influence, R • A density function, f() • A threshold value, T • All points, P, for which dist (P, C) < R • Implicit surface = f (dist(P, C)) – T = 0
Blending Skeletal Elements • Example: metaballs • f(dist) = • Surface drawn where f(dist) – T = 0 Surface drawnat this radius Value of T
Blending Skeletal Elements • Example: two metaballs • Surface drawn where: • f(dist1) + f(dist2) – T = 0 Do we drawsurface here? r1 r2 r2 r1
Blending Skeletal Elements • Yes http://www.lifl.fr/~triquet/implicit/video/blend.mpg
Blending Skeletal Elements • In general, surface defined by multiple surface elements is:
Blending Lines • Lines can bulge when their ends meet • Usually not the desired effect • Tinkering with density function and line separation can fix
Modeling Blood http://www.lifl.fr/~triquet/implicit/video/blood.mpg
Solving Implicit Functions • Root finding • Given a function f, we wish to find the set of x values (1D points) that satisfy f(x)=0 • From calculus, the Intermediate Value Theorem states: “as x varies from a to b, the continuous function f takes on every value between f(a) and f(b)”
Solving Implicit Functions • If f(a) and f(b) have opposite signs, the root is said to be bracketed in the interval [a, b]
Bracketing the roots • Uniformly subdividespace • Evaluate f( ) for eachboundary • Transition from + to –defines bracket
Bisection search • Iteratively subdivide to find exact zero
2-D Implicit Surfaces • Surface defined by f(X) = 0; X = (x, y) • Uniformly subdivide • Evaluate f( ) at all points • Bracket roots
2-D Implicit Surfaces • Find intersection point along all grid lines with +/- values at endpoints • Edge defined by crossing points
2-D: Adaptive Subdivision • Recursively subdivide cells containing a surface crossing down to a threshold size • Calculate crossing values and connect dots to form polygon edge
2-D: Continuation Methods • Overlay fine-grain uniform subdivision • Find start (seed) point that lies on surface • Find cell containing seed point • “Grow” the set of cells across surface • Evaluate adjacent cells to find next surface crossing cells
Potential Problem #1 : Bounding the Domain Space • May not completely contain the object • May miss disconnected components • Will result in “clipping”
Potential Problem #2 : Discretization Error • Too large uniform cell size: • May not be able to converge (entirely miss the surface) • Too large adaptive threshold cell size: • Misses small, completely-containedfeatures • Coarse resolution model • Incorrect topology: • ambiguous cells • connects or breaks components • Too small cells sizes are inefficient and more susceptible to numerical error
Potential Problem #3 : Disconnected Components • Uniform cell subdivision may find them, but inefficiently • Continuation methods may miss them • must have a seed pt on each component • Related to discretization error
Potential Problem #4 : Ambiguous Surface-Crossing Cells • Many cell vertex polarity configurations are ambiguous • Possible to polygonize in different arrangements • May even result in disjoint polygons • Solutions: • Detect and recursively subdivide • Choose a consistent convention (e.g. always join positive pts)
Moving on to 3-D • Conceptually the same • Discretize space and find crossing points on 12 edges of cube • This can be tricky to connect the crossing points into a polygon correctly
3-D: Finding cell polygon face vertices Algorithmic method: • Begin with any edge-surface intersection point (1) • Proceed to negative corner (white open pts) and then clockwise about the cube face (w.r.t outside) until another intersection point is found (2) • Repeat for each subsequent face (34, 45, 51)
3-D: Tetrahedral Decomposition • Tetrahedra reduce ambiguity and produce correct meshes, but many more polygons result • Diagonal edges cut across cube faces • Must make sure adjacent cubes have aligned tetrahedron edges to preserve topological correctness
3-D Tetrahedral Decomposition • Five Six
3-D Implicit Surface Evaluation • Particle Methods • Turk, Hoppe, Szeliski, Witkin, Heckbert (cool paper) • Constrain particles to exist on isosurface • Allow particles to split and join • Particle seeks to balance space between neighbors • A constrained optimization problem
Collision Detection • Easy to detect colliding blobbies • Evaluate sample points from one object in the implicit equation of another • Deforming the blobbies is more complex • Define collision boundary, F1(p) = F2(p) • Create addition term, G(p) that is added to density function, F(p) to prevent passing through collision boundary • Add terms to G(p) so blobbies preserve volume as they are retarded by collision boundary
Spacetime Constraints • Find min of f(x) = y • Find zeros (roots) of derivative function, f’(x) • Newton Raphson Method does this • Find min of f(X) = Y; X and Y vectors • Same method, but find where Jacobian is equal to zero
Spacetime Constraints • Null space of a function • The inputs of a function for which the function evaluates to zero • Finite differences • Approximate derivatives (inverse of Euler integration) • Solving for all forces in time simultaneously