Computer Games CSCI-GA.3033-010 Spring 01 Hubertus Franke ( frankeh@cims.nyu.edu )
Thanks Many thanks to: William H. Hsu Department of Computing and Information Sciences, KSU For allowing the reuse of his excellent course material that he created for the the Eberle book: Public mirror web site: http://www.kddresearch.org/courses/cis636
Acknowledgements Jim Foley Professor, College of Computing & Stephen Fleming Chair in Telecommunications Georgia Institute of Technology James D. Foley Georgia Tech http://bit.ly/ajyfq Andy van Dam T. J. Watson University Professor of Technology and Education & Professor of Computer Science Brown University Steve Feiner Professor of Computer Science & Director, Computer Graphics and User Interfaces Laboratory Columbia University John F. Hughes Associate Professor of Computer Science Brown University Andries van Dam Brown University http://www.cs.brown.edu/~avd/ Steven K. Feiner Columbia University http://www.cs.columbia.edu/~feiner/ John F. Hughes Brown University http://www.cs.brown.edu/~jfh/
Animations: Outline 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [1]: Lasseter s List of Principles (1987) Lasseter, J. (1987). Principles of traditional animation applied to 3D computer animation. Computer Graphics, 1(4), pp. 35-44. SIGGRAPH: http://bit.ly/1dso44 ACM Portal: http://bit.ly/eyxpn 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation []: Squash & Stretch 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [3]: Timing 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [4]: Anticipation Luxo Jr. 1986 Pixar http://www.pixar.com/shorts/ljr/ http://youtu.be/qgxoui3ifs0 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [5]: Staging Luxo Jr. 1986 Pixar http://www.pixar.com/shorts/ljr/ http://youtu.be/qgxoui3ifs0 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [6]: Follow Through & Overlapping Action 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [7]: Straight-Ahead vs. Pose-to-Pose Action 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [8]: Slow In-And-Out 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [9]: Arcs 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [10]: Exaggeration 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [11]: Secondary Action Luxo Jr. 1986 Pixar http://www.pixar.com/shorts/ljr/ http://youtu.be/qgxoui3ifs0 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Traditional Animation [1]: Appeal 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Outline 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Keyframe Animation [1]: Keyframes 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Keyframe Animation []: Interpolation (aka Inbetweening) 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Keyframe Animation [3]: Linear Interpolation aka Lerping 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Keyframe Animation [4]: Cubic Curve (Spline) Interpolation 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Keyframe Animation [5]: Dynamics & Kinematics 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Outline 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [1]: Definition 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures []: Character Modeling 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [3]: Angular Interpolation 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [4]: Bones & Joints 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [5]: Example Walk Cycle 1 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [6]: Example Walk Cycle 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [7]: Example Walk Cycle 3 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Articulated Figures [7]: Example Walk Cycle 4 00 D. M. Murillo http://bit.ly/ez9ma8 010 J. Lawrence, University of Virginia CS 4810: Introduction to Computer Graphics http://bit.ly/hpixdi
Resources [1]: Basic Maya Tutorials - Ross Maya Tutorial: Basics 011 A. F. Ross Playlist: http://bit.ly/dfptwq
Resources []: Animation Tutorials - Lammers Maya 4 Fundamentals 001 J. Lammers & L. Gooding, http://amzn.to/ewvrkn Maya 4.5 Fundamentals 003 J. Lammers & L. Gooding, http://bit.ly/hxtpl1 Maya 5 Fundamentals 006 G. Lewis & J. Lammers, http://amzn.to/g01ct
Resources [3]: Examples Online Maya Animation at Animation Arena 004 011 G. Nakpil, Toronto, CANADA http://bit.ly/gxxqtg 001 J. Wilson, http://bit.ly/hxtpl1 Student art gallery for Maya 4 Fundamentals (http://amzn.to/eold3q)
003 008 Unreal Wiki http://bit.ly/dlrkxn Rigging Tin Can Man, Unreal Wiki
Maya Tutorial Part 1: Modeling, 003 008 Unreal Wiki http://bit.ly/h9lrmt Part A Modeling
Maya Tutorial Part : Rigging, 003 008 Unreal Wiki http://bit.ly/gczijw Part B Rigging
Character Modeling in Maya [1]: Muscle Models & Deformations Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya []: Deform Blend Shape Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya [3]: Animate Set Driven Key Set Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya [4]: Driver Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya [5]: Blend Shape Deformation Setup Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya [6]: Inverse Kinematics (IK) Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
Character Modeling in Maya [7]: Controlling Deformation & Rotation Adapted from material 003 L. Neuberger, http://bit.ly/gqbz0d Alfred State College, State University of New York
00-003 PlanetSack Tutorials http://bit.ly/hocnu1 Cloth Modeling in Maya [1]: More Driven Keys & Blend Shape
00-003 PlanetSack Tutorials http://bit.ly/hocnu1 Cloth Modeling in Maya []: Output
Particle Systems [1]: Natural Effects Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Systems []: Advantages Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Systems [3]: Basic Model Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Uses of Particle Systems Explosions Large Fireworks Fire Vapor Clouds Dust Fog Smoke Contrails Water Waterfalls Streams Plants Command & Conquer 4: Tiberian Twilight 010 Electronic Arts, Inc. Wikipedia: http://bit.ly/gfgmjo Adapted from slides 008 R. Malhotra, CSU San Marcos CS 536 Intro to 3-D Game Graphics, Spring 008 http://bit.ly/hnhuue
History of Particle Systems Spacewar! 196 S. Russell et al. Wikipedia: http://bit.ly/eaiwuw Asteroids 1979 L. Rains & E. Logg Wikipedia: http://bit.ly/hwfeqk Star Trek II 1983 Paramount Wikipedia: http://bit.ly/exwrhb Spacewar! (196) Used Pixel Clouds as Explosions Asteroids (1979) First Physically-Based PS/Collision Model in Games Star Trek II (1983) Particle Fountain: http://youtu.be/qe9qslyk5q4 Hey, Hey, 16K 000 M. J. Hibbett, Video 004 R. Manuel http://youtu.be/ts96j7hho8 Adapted from slides 008 R. Malhotra, CSU San Marcos CS 536 Intro to 3-D Game Graphics, Spring 008 http://bit.ly/hnhuue
Definition & Physically-Based Model Adapted from slides 008 R. Malhotra, CSU San Marcos CS 536 Intro to 3-D Game Graphics, Spring 008 http://bit.ly/hnhuue
Particle Generation Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particles per Area Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Emission Rate as a Function of Time Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Attributes Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Dynamics & Kinematics Dynamics: Study of Motion & Changes in Motion Forward: model forces over time to find state, e.g., Given: initial position p 0, velocity v 0, gravitational constants Calculate: position p t at time t Inverse: given state and constraints, calculate forces, e.g., Given: desired position p t at time t, gravitational constants Calculate: position p 0, velocity v 0 needed Wikipedia: http://bit.ly/hh43dx (see also: Analytical dynamics ) For non-particle objects: rigid-body dynamics (http://bit.ly/dlvejg) Kinematics: Study of Motion without Regard to Causative Forces Modeling systems e.g., articulated figure Forward: from angles to position (http://bit.ly/ehd1c) Inverse: finding angles given desired position (http://bit.ly/hsytb0) Wikipedia: http://bit.ly/hr8ru Forward Kinematics 009 Wikipedia
Particle Dynamics Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Extinction Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Modeling Water Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Systems []: Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Particle Systems for Multi-Body Systems Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Rigid Body Dynamics: How to Do It? Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Distance between Particles: Keep Constant Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Verlet Integration Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Modeling Joints Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Setting Joint Limits Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Collision Detection Redux Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Friction Force Adapted from slide 008 H. P. H. Shum, RIKEN ( 理 研 ) Computer Animation, http://bit.ly/ig6ktk
Summary Reading for Last Class: Chapter 7, 8.4, Eberly e Reading for Today: 8.3 8.4, 4., 5.0, 5.6, 9.1, Eberly e Reading for Next Class: 9.1, Particle System Handout Last Time: Picking OpenGL modes: rendering (default), feedback, selection Name stack Hit records Rendering in selection mode using selection buffer Color coding of pickable objects Today: Interaction Handling & Human Computer Interaction (HCI) Spectrum of interaction Kinds of interaction User input: selection, control Stimuli: much more when we cover visualization, color Next: Particle Systems, Collision Response
Inverse Kinematics Control & Ragdoll Physics William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://bit.ly/hgvxlh / http://bit.ly/evizre Public mirror web site: http://www.kddresearch.org/courses/cis636 Instructor home page: http://www.cis.ksu.edu/~bhsu Readings: Last class: Particle System Handout Today: 5.3, Eberly e see http://bit.ly/ieuq45; CGA Handout Next class: Chapter 14, Eberly e Reference: Wikipedia, Inverse Kinematics, http://bit.ly/hr8ru Reference: Wikipedia, Ragdoll Physics, http://bit.ly/3ogguz
Kinematics Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Degrees of Freedom (DOFs) [1]: Translational & Rotational Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Degrees of Freedom (DOFs) []: Robot Arm Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Configuration Space Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Work Space vs. Configuration Space Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
More Examples Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Controlled DOFs Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Hierarchical Kinetic Modeling Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Robot Parts & Terms Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Example: Puma 560 Robot Wikipedia, Programmable Universal Machine for Assembly (PUMA): http://bit.ly/fbmram Adapted from slides 00 R. Melamud, Stanford University Mirrored at CMU 16-311 Introduction to Robotics, http://generalrobotics.org
Joint Types: Revolute, Prismatic, Spherical Adapted from slides 00 R. Melamud, Stanford University Mirrored at CMU 16-311 Introduction to Robotics, http://generalrobotics.org
More Complex Joints Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Hierarchical Representation Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Forward vs. Inverse Kinematics Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Forward Kinematics [1]: Definition & General Approach Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Forward Kinematics []: Illustration? θ 1 θ θ 3 End Effector Base r = Choi x r f(θ) e= f ( Φ) Rotenberg Adapted from slides 00 K. J. Choi, Seoul National University Graphics and Media Lab (http://graphics.snu.ac.kr) mirrored at: http://bit.ly/hnzsan
Forward Kinematics [3]: Joint Angles to Bone Coordinates Adapted from slides 004 005 S. Rotenberg, UCSD CSE169: Computer Animation, Winter 005 http://bit.ly/f0vian
Inverse Kinematics [1]: Definition & General Approach Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Inverse Kinematics []: Illustration For more on characters & IK, see: Advanced Topics in CG Lecture 05 θ 1? θ θ 3? End Effector Base r θ = r f 1 ( x) Φ = f 1 ( e) Choi Rotenberg Adapted from slides 00 K. J. Choi, Seoul National University Graphics and Media Lab (http://graphics.snu.ac.kr) mirrored at: http://bit.ly/hnzsan
Inverse Kinematics [3]: Demos 008 M. Kinzelman http://youtu.be/l5yz491kpo 007 A. Brown http://youtu.be/6jdlolazjj0 008 T. Komura, H. S. Lim, & R. W. H. Lau http://youtu.be/fjtbmnp6ocm 011 K. Iyer http://youtu.be/yvrbwirapse
Inverse Kinematics [4]: Analytic Solution for -Link Case θ θ 1 a 1 a O O 1 O 0 x 1 x 0 x y 1 y y 0 φ ψ (x,y) θ ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) 1 1 1 1 1 1 1 1 1 1 1 1 1 tan cos 1 cos 1 tan for greater accuracy cos ) cos( a a y x y x a a a a y x y x a a a a y x aa a a y x aa aa a a y x aa a a y x + + + =± + + + = + + + + = + = + = + = + θ θ θ θ θ θ π Two solutions: elbow up & elbow down Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Inverse Kinematics [5]: Iterative IK Solutions Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Jacobian [1]: 6x6 DOF Case Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Jacobian []: Solution Adapted from slides 000 005 D. Brogan, University of Virginia CS 551, Advanced CG & Animation http://bit.ly/huxrqd
Another IK Problem: Revolute & Prismatic Joints Combined (x, y) Finding : y θ=arctan( x ) Y More Specifically: y θ=arctan ( ) x arctan() specifies that it s in the first quadrant S 1 Finding S: X S= (x + y ) Adapted from slides 00 R. Melamud, Stanford University Mirrored at CMU 16-311 Introduction to Robotics, http://generalrobotics.org
Type of Procedural Animation Ragdoll Physics [1]: Definition Automatically generates CGA directives (rotations) Based on simulation Rigid-body dynamics Articulated Figure Gravity No autonomous movement Used for inert body Usually: character death (car impact, falling body, etc.) Less often: unconscious, paralyzed character Collisions with Multiple Bodies Inter-character Character-object Falling Bodies 1997 001 Animats http://www.animats.com
Ragdoll Physics []: Demos 007 N. Picouet http://youtu.be/ohnqcb--ass 006 P. Pelt http://youtu.be/6jdlolazjj0 See also: http://youtu.be/5_qisi0fyau 009 M. E. Cerquoni http://youtu.be/uw_dkqvkv8 010 M. Heinzen (Arkaein) http://bit.ly/guj9su / http://youtu.be/fjtbmnp6ocm
Physically-Based Modeling (PBM) [1]: Looking Back Particle Dynamics Emitters 0-D (points), 1-D (lines), -D (planes, discs, cross-sections) e.g., fireworks (0-D); fountains (0/1/-D); smokestacks, jets (-D) Simulation: birth-death process, functions of particle age/trajectory Rigid-Body Dynamics Constrained systems of connected parts Examples: falling rocks, colliding vehicles, rag dolls Articulated Figures More References ACM, Intro to Physically-Based Modeling: http://bit.ly/hhqvxd Wikipedia, Physics Engine: http://bit.ly/h4pirt Wikipedia, N-Body Problem: http://bit.ly/1aywwe Rocks fall Everyone dies
Physically-Based Modeling (PBM) []: Applications in Movies & Games Star Wars Episode I: The Phantom Menace 1999 Lucasfilm, Inc. http://youtu.be/d4psmxuci-0
Summary Reading for Today: 5.3, Eberly e ; CGA Handout Reading for Next Class: Chapter 14, Eberly e Last Class: Lab on Particle Systems; Dissection of Working Program Today: Computer-Generated Animation Concluded CGA of autonomous agents (robots, swarms) vs. animation by hand Degrees of freedom (DOFs) and kinds of joints Forward kinematics (FK) Forward problem illustrated Control problem Inverse kinematics (IK) IK (finding angles) vs. mechanical problem of finding forces Analytical models Iterative models (Jacobian-based) Ragdoll physics Next Class: Ray Tracing, Part 1 of
Terminology Emitter Point, Line, Plane or Region from which Particles Originate Particle Fountain Particle System with Directional Emitter Sprite (Wikipedia: http://bit.ly/gyinpg) Definition: -D image or animation made part of larger scene Point sprite (Saar & Rotzler, 008): http://bit.ly/fkjbpy Joints: Parts of Robot / Articulated Figure That Turn, Slide Revolute: able to turn (rotate), forming angle between bones Prismatic (aka slider): bone slides through http://bit.ly/hscjoe Spherical (aka ball joint): bone rotates around socket Cylindrical (aka hinge): flaps wrap around joint, joined to surfaces Effectors: Parts of Robot / Articulated Figure That Act (e.g., Hand, Foot) Bones: Effectors, Other Parts That Rotate about, Slide through Joints Procedural Animation: Automatic Generation of Motion via Simulation Ragdoll physics: procedural animation for inert characters Other types: particle systems, N-body dynamics