1 / 73

CS 352: Computer Graphics

CS 352: Computer Graphics. Hierarchical Graphics, Modeling, And Animation. Overview. Modeling Animation Data structures for interactive graphics CSG-tree BSP-tree Quadtrees and Octrees Visibility precomputation

adamdaniel
Download Presentation

CS 352: 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 352: Computer Graphics Hierarchical Graphics, Modeling, And Animation

  2. Overview • Modeling • Animation • Data structures for interactive graphics • CSG-tree • BSP-tree • Quadtrees and Octrees • Visibility precomputation • Many figures and examples in this set of lectures are from The Art of 3D Computer Animation and Imaging, by I. Kerlow

  3. Modeling • The modeling problem • Modeling primitives • Polygon • Sphere, ellipsoid, torus, superquadric • NURBS, surfaces of revolutions, smoothed polygons • Particles • Skin & bones • Approaches to modeling complex shapes • Tools such as extrude, revolve, loft, split, stitch, blend • Constructive solid geometry (CSG) • Hierarchy; kinematic joints • Inverse kinematics • Keyframes

  4. Representing objects • Objects represented as symbols • Defined in model coordinates; transformed into world coordinates (M = TRS) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glTranslatef(…); glRotatef(…); glScalef(…); glutSolidCylinder(…);

  5. Primitives • The basic sort of primitive is the polygon • Number of polygons: tradeoff between render time and model accuracy

  6. SplineCurves • Linear spline • Cardinal spline • B-spline • Bezier curve • NURBS (non-uniform rational b-spline)

  7. Mesh

  8. Mesh deformations

  9. Sweep • Sweep a shape over a path to form a generalized cylinder

  10. Revolution • Revolve a shape around an axis to create an object with rotational symmetry

  11. Extrusion • Extrude: grow a 2D shape in the third dimension • Shape is created with a (1D)b-spline curves • Hole was created by subtracting a cylinder

  12. Joining Primitives • Stitching, blending

  13. Modifying Primitives

  14. Subdivision Surfaces • Can set level of polygon subdivision

  15. Skin and Bones • Skeleton with joined “bones” • Can add “skin” on top of bones • Automatic or hand-tunedskinning

  16. Particles

  17. Algorithmic Primitives Algorithms for trees, mountains, grass, fur, lightning, fire, …

  18. Geometric model file formats • .obj: Alias Wavefront • .dxf: Autocad • .vrml: Inventor • Dozens more • Can convert between formats • Converting to a common format may lose info…

  19. Hierarchical models • When animation is desired, objects may have parts that move with respect to each other • Object represented as hierarchy • Often there are joints with motion constraints • E.g. represent wheels of car as sub-objects with rotational motion (car moves 2 pi r per rotation)

  20. DAG models • Could use tree torepresent object • Actually, a DAG (directed acyclicgraph) is better: can re-use objects • Note that each arrow needs aseparate modeling transform • In object-oriented graphics, alsoneed motion constraints with eacharrow

  21. Example: Robot • Traverse DAG using DFS (or BFS) • Push and pop matrices along the way (e.g. left-child right-sibling) (joint position parameters?)

  22. Modeling Programs • Moray • Shareware • Limited functionality • Easy • Lightwave, Maya • NOT shareware • Very full-featured • Difficult to learn and use • Moray, Maya demos; Lightwave video

  23. Animation • Suppose you want the robot to pick up a can of oil to drink. How? • You could set the joint positions at each moment in the animation (kinematics)

  24. Inverse Kinematics • You can’t just invert the joint transformations • Joint settings aren’t even necessarily unique for a hand position! • Inverse kinematics: figure out from the hand position where the joints should be set.

  25. Using Inverse Kinematics • Specify joint constraintsand priorities • Move end effector(or object pose) • Let the system figureout joint positions • [IK demo]

  26. Keyframe Animation • In traditional key frame animation the animator draws several important frames, and helpers do the “inbetweening” or “tweening” • Computer animation is also key-frame based • At key frames, animator positions objects and lights, sets parameters, etc. • The system interpolates parameter values linearly or along a curve • To get from one object pose to the next, inverse kinematics determine joint motions • [Keyframe animation demo]

  27. Motion Capture • More realistic motion sequences can be generated by Motion Capture • Attach joint position indicatorsto real actors • Record live action

  28. Morphing • Morphing: smoothly shifting from one image to another • First popularized in a Michael Jackson video • Method: a combination of • Warping both images, gradually moving control points from location in first image to location in the second • Cross-fading from first image sequence to second

  29. 3D Morphing • Define 3D before andafter shapes as e.g. NURBS surfaces with same number ofcontrol points • Gradually move control points fromfirst setting to second • Specify key poses: e.g. smile, frown, 12 frames of walking motion

  30. Combined approaches

  31. Example: virtual puppetry • Suppose you want to display virtual puppet shows • How could you animate puppet movements? • How could you control the animations externally?

  32. Character Animation • To make computer graphics(or cartoon drawings) come alive…

  33. Personality through Pose, Expression, Motion, Timing

  34. Object-oriented Graphics • Higher in the programming hierarchy: control models with object-oriented programs robot robbie; robbie.smile(); robbie.walk(270, 5, 3);

  35. Data Structures for Modeling • This part of chapter: how some example applications be done efficiently (i.e. topics without a better home…) • Tree-based subdivisions of space • Example 1: how to represent complex objects made up of union, intersection, difference of other objects

  36. CSG Tree

  37. Application 2: HSR • How to render in 3D with hidden surface removal when you don’t have a hardware depth-buffer? • Can you think of any other ways of removing hidden surfaces quickly? • Principle: a polygon can’t be occluded by another polygon that is behind it.

  38. BSP-tree • The painter’s algorithm for hidden surface removal works by drawing all faces, from back to front • How to get a listing of the faces in back-to-front order? • Put them into a binary tree and traverse the tree (but in what order?)

  39. BSP Tree Figures • Right is “front” of polygon; left is “back” • In and Out nodes show regions of space inside or outside the object • (Or, just store split pieces of polygons at leaves)

More Related