Download presentation
Presentation is loading. Please wait.
Published byJonah Jennings Modified over 9 years ago
1
CS 551/651 Advanced 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) = elastic Figure 3.55
7
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
9
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
10
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
13
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
14
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
15
Trilinear Interpolation Let S, T, and U (with origin P 0) define local coord axes of bounding box that encloses geometry A vertex, P’s, coordinates are:
16
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
17
Examples
18
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
20
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
22
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
24
Morphing 2D image metamorphosis –Coordinate Grid Approach –Feature-Based Approach
25
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
26
Two-pass Rendering Overview Figure 3.79
27
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
28
Morphing Images to Intermediate –Use scanline method to compute what pixels from source image map to a particular pixel of intermediate image
29
Feature-Based Morphing Simplest case: user draws one ray on source and destination images to define morph
30
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
31
Local Coordinate Systems
32
Perform similar local coordinate system computation for destination image –Build s/t axes
33
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
34
Necessary Details More than one line –Perform mapping for all line segments –Weight each line segment’s contribution to averaged color value Q 2 – Q 1 = distance of line segment dist is distance from pixel to line a and b are user specified
35
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
36
Assignment 2 Due 2 weeks from today Implement Beier-Neely morphing using fltk and OpenGL –http://www.hammerhead.com/thad/morph.htmlhttp://www.hammerhead.com/thad/morph.html Details online tonight
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.