100 likes | 266 Vues
COMPUTER GRAPHICS. CS 482 – FALL 2014. OCTOBER 13, 2014. IMPLICIT REPRESENTATIONS. IMPLICIT FUNCTIONS IMPLICIT SURFACES MARCHING CUBES. IMPLICIT FUNCTIONS. DEFINITION.
E N D
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 13, 2014 IMPLICIT REPRESENTATIONS • IMPLICIT FUNCTIONS • IMPLICIT SURFACES • MARCHING CUBES
IMPLICIT FUNCTIONS DEFINITION EXPLICIT FUNCTIONS ARE THOSE IN WHICH A DEPENDENT VARIABLE CAN BE EXPRESSED IN TERMS OF ONE OR MORE INDEPENDENT VARIABLES, SUCH AS IMPLICIT FUNCTIONS ARE REPRESENTED BY EQUATIONS THAT CANNOT NECESSARILY BE WRITTEN AS EXPLICIT FUNCTIONS, USING THE FORMAT CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 175
IMPLICIT SURFACES LEVEL SETS All of the points where the implicit function’s equality is valid comprise the implicit surface for the function. All of the points where the implicit function evaluates to less than zero comprise the interior of the implicit surface for the function. All of the points where the implicit function evaluates to greater than zero comprise the exterior of the implicit surface for the function. INTERIOR EXTERIOR IMPLICIT SURFACE CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 176
IMPLICIT SURFACES RAY TRACING Implicit functions are often represented by samples (e.g., using a regular grid and determining which grid points are closest to the level set). Similarly, ray tracing implicit surfaces may be simplified by merely sampling each ray at regular intervals and taking note of when the transition occurs between the exterior and the interior of the ray. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 177
IMPLICIT SURFACES CONSTRUCTIVE SOLID GEOMETRY IMPLICIT SURFACES LEND THEMSELVES TO BASIC CSG FUNCTIONALITY. IMPLICIT SURFACE IMPLICIT SURFACE DIFFERENCE UNION INTERSECTION CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 178
IMPLICIT SURFACES SIMPLIFYING POLYGON SOUP Polygonal data sets often contain holes, gaps, excessive detail, and faces with bad aspect ratios, which could inhibit many of the graphical calculations needed to effectively render them (e.g., collision detection). By interpolating over the polygonal data set and constraining normal vectors to inhibit excessive oscillation, an implicit surface can be developed to tightly enclose the original polygonal data set and facilitate performing needed calculations. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 179
MARCHING CUBES IMPLICIT CURVE APPROXIMATION Implicit curves and surfaces are usually difficult to pinpoint precisely, but their interiors and exteriors are usually easy to distinguish, making it straightforward to approximate them via marching cubes. A grid of points is set up, with some of the grid points inside the object being rendered (in this case, a circle), and the rest outside. The midpoint of each border segment (i.e., a grid segment with one endpoint inside the object and the other outside) is determined. These points are joined to form an approximation of the circular object. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 180
MARCHING CUBES IMPLICIT SURFACE APPROXIMATION This approach can be extended to three dimensions by first noticing that there are 15 basic ways in which a 3-D object’s interior and exterior can relate to a cube that it intersects. The red vertices denote corners that have tested as inside the object and the blue vertices denote corners that have tested as outside the object. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 181
MARCHING CUBES MIDPOINT-BASED INTERSECTIONS By only rendering the midpoint-based planar intersections with the individual voxels, we can obtain a good approximation of the original object, and can resolve the hidden surface problem relatively easily. Of course, the finer the grid, the better the resulting image. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 182
MARCHING CUBES ADAPTIVE INTERSECTIONS The image can be dramatically improved by using the actual intersection points between the object and the grid segments instead of the midpoints. Naturally, this “adaptive” approach significantly increases the computational complexity of the algorithm. CS 482 – FALL 2014 OCTOBER 13, 2014: IMPLICIT REPRESENTATIONS PAGE 183