1 / 36

CS 551/651 Advanced Computer Graphics

CS 551/651 Advanced Computer Graphics. Warping and Morphing Spring 2002. Deforming Objects. Changing an object’s shape Usually refers to non-simulated algorithms Usually relies on user guidance Easiest when shape number of faces and vertices is preserved Define the movements of vertices.

uzuri
Download Presentation

CS 551/651 Advanced Computer Graphics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 551/651Advanced Computer Graphics Warping and Morphing Spring 2002

  2. Deforming Objects • Changing an object’s shape • Usually refers to non-simulated algorithms • Usually relies on user guidance • Easiest when shape number of faces and vertices is preserved • Define the movements of vertices

  3. Moving Vertices • Time consuming to define the trajectory through space of all vertices • Instead, control a few seed vertices which in turn affect nearby vertices

  4. Defining Vertex Functions • If vertex i is displaced by (x, y, z) units • Displace each neighbor, j, of i by • (x, y, z) * f (i, j) • f (i,j) is typically a function of distance • Euclidean distance • Number of edges from i to j • Distance along surface

  5. Vertex Displacement Function • i is the (shortest) number of edges between i and j • n is the max number of edges affected • (k=0) = linear; (k<0) = rigid; (k>0) = elastic • Figure 3.55

  6. 2-D Grid Deformation • 1974 film “Hunger” • Draw object on grid • Deform grid points • Use bilinear interpolation to recompute vertex positions on deformed grid • Draw example on board • Figure 3.57

  7. Polyline Deformation • Draw a piecewise linear line (polyline) through the geometry • For each vertex compute • Closest polyline segment • Distance to segment • Relative distance along this segment • Deform polyline and recompute vertex positions

  8. Global Deformations • Alan Barr, SIGGRAPH ’84 • A 3x3 transformation matrix affects all vertices • P’=M(P) .dot. P • M(P) can taper, twist, bend… • Figure 3.65 3.66

  9. Free-Form Deformation (FFD) • Sederberg, SIGGRAPH ’86 • Position geometric object in local coordinate space • Build local coordinate representation • Deform local coordinate space and thus deform geometry

  10. FFD • Similar to 2-D grid deformation • Define 3-D lattice surrounding geometry • Move grid points of lattice and deform geometry accordingly • Local coordinate system is initially defined by three (perhaps non orthogonal) vectors

  11. Trilinear Interpolation • Let S, T, and U (with origin P0) define local coord axes of bounding box that encloses geometry • A vertex, P’s, coordinates are:

  12. Volumetric Control Points • Each of S, T, and U axes are subdivided by control points • A lattice of control points is constructed • Bezier interpolation of move control points define new vertex positions

  13. Examples

  14. Using FFDs to Animate • Build control point lattice that is smaller than geometry • Move lattice through geometry so it affects different regions in sequence • Animate mouse under the rug, or subdermals (alien under your skin), etc. • Figure 3.74

  15. Using FFDs to Animate • Build FFD lattice that is larger than geometry • Translate geometry within lattice so new deformations affect it with each move • Change shape of object to move along a path • Figure 3.75

  16. Animating the FFD • Create interface for efficient manipulation of lattice control points over time • Connect lattices to rigid limbs of human skeleton • Figure 3.77 • Physically simulate control points

  17. Morphing • 2D image metamorphosis • Coordinate Grid Approach • Feature-Based Approach

  18. Coordinate Grid • Source and destination images • Overlay upon both a 2-D lattice of points • Points along edges must remain on edges • Internal points can be in different positions • Same number of points in both • Points define movement of pixels

  19. Two-pass RenderingOverview • Figure 3.79

  20. Morphing Images to Intermediate • First stretch in x direction and then in y direction • Auxiliary lattice has x coordinates from source and y coordinates from intermediate lattice

  21. Morphing Images to Intermediate • Use scanline method to compute what pixels from source image map to a particular pixel of intermediate image

  22. Feature-Based Morphing • Simplest case: user draws one ray on source and destination images to define morph

  23. Local Coordinate Systems • Let the root of the ray in source image be the coordinate system origin • Let the ray in source image correspond to the v axis (unit length) • Construct perpendicular to this ray for u axis • Every pixel (x, y) of image now mapped to (u, v) using projection to u/v axes

  24. Local Coordinate Systems

  25. Local Coordinate Systems • Perform similar local coordinate system computation for destination image • Build s/t axes

  26. Mapping Destination to Source • (x, y)dest --- (s, t) • (s, t) --- (u, v) • (u, v) --- (x, y)source • Color (x, y)dest with (x, y)source

  27. Necessary Details • More than one line • Perform mapping for all line segments • Weight each line segment’s contribution to averaged color value • Q2 – Q1 = distance of line segment • dist is distance from pixel to line • a and b are user specified

  28. Necessary Details • Mapping from destination to pixel to source pixel will not land on pixel centers • Aliasing results… • Use quadrilateral centered at source (u, v) location to sample multiple pixels and average

  29. Assignment 2 • Due 2 weeks from today • Implement Beier-Neely morphing using fltk and OpenGL • http://www.hammerhead.com/thad/morph.html • Details online tonight

More Related