Upload
amia-ramirez
View
221
Download
2
Embed Size (px)
Citation preview
COMP 304Computer Graphics II
LECTURE 8
MOTION CONTROL – FORWARD KINEMATICSDr. Mehmet Gokturk
Asst. Prof., Gebze Institute of Technology
© M. Gokturk 2
Some Timeline The Illusion of Motion 1824, Peter Mark Roget,"Persistence of Vision with Regard to
Moving Objects“ a series of images shown in rapid sequence can appear to move
fluidly (i.e. a flip book or film projector)
© M. Gokturk 3
© M. Gokturk 4
Timeline Movies (1895) age of movie camera and projector begins
– experimentors discover they can stop the crank and restart it again to obtain special effects
(1914) Gertie, Windsor McCay (newspaper cartoonist)– first popular animation
(1928) Steamboat Willie, Disney– an early cartoon w/ sound– cartoons seem plausible as entertainment
(1933) King Kong, Willis O’Brien
(1930’s & 40’s) Golden age of cartoons– Betty Boop, Popeye, Porky Pig, Daffy Duck, Bugs Bunny, Woody Woodpecker, Mighty
Mouse, Tom & Jerry
(1937) Snow White, Disney– animated feature film– cost is $1.5M
© M. Gokturk 5
Timeline Movies (cont) (1982) Tron, MAGI
– movie with a computer graphics premise
(1984) Last Starfighter– computer graphics was used interchangably with actual models of the spaceship
(1993) Jurassic Park– computer graphics is used to create living creatures that are meant to appear
realistic
(1995) Toy Story, Pixar– full-length feature film done entirely with 3D computer animation
(2000) CyberWorld 3D, IMAX– 3D IMAX full-length feature film including characters from popular 3D movies such
as ANTZ and The Simpsons’ Homer
© M. Gokturk 6
Conventional Animation Techniques Drawing on film Multiple drawings Rotoscoping (project film of real actors onto
drawing paper) Stop motion animation Acetate cels, multiple plane cells
© M. Gokturk 7
Conventional Animation Process Storyboard Key frames drawn
– Straight ahead vs. pose-to-pose Intermediate frames filled in
(inbetweening) Trial film is made
(called a pencil test) Pencil test frames transferred to cels
© M. Gokturk 8
Conventional Animation Process
© M. Gokturk 9
Role of the Computer In-betweening
– artistic example: Hunger, Peter Foldes 1974
Disney’s CAPS system– scanned artist drawings are read in– "cels" are colored online (broad color palette, exact color matching)– compositing is done online (background, 2D drawings, 3D animation)– 3D effects can be created with 2D drawings (e.g. Beauty and the Beast)– used in every film since Beauty & Beast
3D graphical worlds– can experiment more easily with actor position, camera position– can perform more complex camera moves– exchange labor to create drawings with labor to build and animate 3D
world
© M. Gokturk 10
3D Animation 3D animation is similar to stop
motion animation
King Kong (1932)
Flash Gordon (1972)
http://www.stopmotionanimation.com/
© M. Gokturk 11
3D Animation Stop motion animation
(Nightmare Before Christmas)
3D keyframing(Luxo Jr.)
Performance animation and motion capture (Donkey Kong Country)
Which must be done straight-ahead and which can be animated pose-topose?
© M. Gokturk 12
Keyframing Key frames mark important visual transitions (extremes of
action) Inbetweening is creation of intermediate frames between
the key frames Can easily be calculated by computer
© M. Gokturk 13
Temporal Sampling
Film recording takes samples of an image at fixed time intervals– 24 frames per second for film– 30 frames per second for video
human eye "sees" continuous motion
Sometimes, fewer keyframes are required to describe the motion, especially for “pencil tests” or rough choreography (e.g., Lost World)
© M. Gokturk 14
No internal energy source and move only when an external force acts on them.
Read for use when: – physical laws encoded – initial conditions specified
Pools of water, clothing, hair, leaves
Smooth Motion Passive Physics
© M. Gokturk 15
Clothing (Geri’s Game)
Water (Antz)
“Rigid” body physics (crashing space pods in Phantom Menace)
Geri’s Game, Pixar Animation Studios
Smooth Motion Passive Physics
See examples
© M. Gokturk 16
User specifies keyframes (start, end, middle) User specifies constraints (e.g. laws of physics) System searches for minimum energy motion to accomplish
goals
A. Witkin and M. Kass,“Spacetime Constraints”,SIGGRAPH ‘88.
Smooth Motion Active Physics
© M. Gokturk 17
Smooth Motion Active Physics and Simulation
Control an animated character as we would control a robot
behavior is simulated
a "control system" sends proper signals to the character’s "muscles" over time
Mark Raibert’s leg lab at MIT
http ://www.ai.mit.edu/projects/leglab/
© M. Gokturk 18
Noise Motion We generally don’t want motion to be too smooth The eye picks up symmetries and smooth curves and interprets them
as artificial or fake By adding noise, we can add texture to smooth motion
K. Perlin, “An Image Synthesizer”,Computer Graphics, 19(3), July 1985.
Perlin, Improv system(K. Perlin and A. Goldberg, SIGGRAPH ‘96).
Applets: http://www.mrl.nyu.edu/~perlin/
© M. Gokturk 19
Noise Motion Motion capture (natural noise!)
© M. Gokturk 20
Camera Path Following A simple type of animation everything remains static
except the camera (walk throughs or flybys).
The camera just as any other object as far as orientation and positioning is concerned.
The user needs to construct a path through space for the observer to follow along with orientation information.
Path = key frame positioning + interpolation of the inbetween frames.
© M. Gokturk 21
Camera Path Following ways to deal with the view direction (1) The center of interest can be held constant while
observer position is interpolated along a curve
View Direction Vector between the observer position (POS) and the center of interest (COI)
This is useful when the observer is flying over an environment inspecting a specific location such as a building.
© M. Gokturk 22
Camera Path Following ways to deal with the view direction (2) A path for the center of interest can be constructed,
say from a series of buildings in an environment.
Often, the animator will want the center of interest to stay focused on one building for a few frames before it goes to the next building.
© M. Gokturk 23
Camera Path Following ways to deal with the view direction (3) Alternatively, the center of interest can be controlled by
other points along the observer path.
For example, observer position for the next frame can be used to determine the view direction for the current frame.
Sometimes this is too jerky. Some nth frame beyond the current frame can be used to produce a smoother view direction.
© M. Gokturk 24
Camera Path Following ways to deal with the view direction (4)
The center of interest can also be attached to objects in the animation.
© M. Gokturk 25
Path following Have position and orientation interpolation for key
framing now
Combining them , get general motions of rigid objects– Add scaling, get stretching/squashing
Path following: – Have keys only for position– how to change orientation “naturally”
Same techniques for camera motion
© M. Gokturk 26
Orientation along a path It’s natural to change orientation as things move Example: looking while walking
– Look in the direction one walks Tedious to specify orientations along the way Want to get directly from the path
© M. Gokturk 27
Frenet frame (Moving frame) At each point on the curve:
– Get Tangent vector– Get vector in general curvature direction
• In the plane of tangent and curvature vector– Vector orthogonal to the two
Math:
Everything is normalized then
wuvsPsPusPw
);()();(
© M. Gokturk 28
© M. Gokturk 29
© M. Gokturk 30
Frenet frame Curvature can be zero along extended parts
– Example: straight line
Solution: interpolate boundary frames– Differ only by rotation around the straight line
Zero curvature at a point:– Possible flip (ex. camera flips upside down)
Discontinuities in curvature:– Sudden changes of object orientation
These effects are NOT tolerable
© M. Gokturk 31
Alternatives Tangent vector is ok for objects
– Poor choice for cameras
For cameras: Look at the “center of interest”– Fixed COI: Always look at particular point– Separate path for COI
• Can animate this point separately using extra key positions
© M. Gokturk 32
Alternatives COI (center of interest) travels in front of the camera
– COI(s)=P(s+ds)– At the end, along the final tangent vector
Choose several ds, average– Smoothes motion– Trade-off: jerky motion vs. too static view direction
“Up” vector:– In the plane of view vector and global UP vector– Extra offset from this direction– Full key framing
© M. Gokturk 33
© M. Gokturk 34
Path Following
w = P’(u)
P’’(u)
u = P’(u) x P’’(u)
v = w x u
Frenet Frame
© M. Gokturk 35
Curvature continuity
=0
© M. Gokturk 36
Look ahead
© M. Gokturk 37
Define “look-at” vector
© M. Gokturk 38
Define “up” vector
© M. Gokturk 39
© M. Gokturk 40
© M. Gokturk 41
© M. Gokturk 42
© M. Gokturk 43
Kinematics X Dynamics
© M. Gokturk 44
Kinematics
© M. Gokturk 45
Kinematics
Keyframing requires that the user supply the key frames
For articulated figures, we need a way to define the key frames
There are two ways to pose an articulated character – forward and inverse kinematics
Kinematics is the study of motion without regard to the forces that cause the motion Kinematics
© M. Gokturk 46
© M. Gokturk 47
Articulated ModelsArticulated models:
– rigid parts– connected by joints
They can be animated by specifying the joint angles (or other display parameters) as functions of time.
t1 t2
qi q ti ( )
t1 t2
See example animation clips
© M. Gokturk 48
Some robotics is required !
© M. Gokturk 49
© M. Gokturk 50
© M. Gokturk 51
Drawing Articulated Figures
© M. Gokturk 52
Static Figure Transformations
© M. Gokturk 53
Forward Kinematics Control
© M. Gokturk 54
Example: 2-Link Structure
© M. Gokturk 55
Forward Kinematics
© M. Gokturk 56
Forward Kinematics
© M. Gokturk 57
Forward Kinematics
© M. Gokturk 58
Forward Kinematics
© M. Gokturk 59
Forward Kinematics
Hierarchical model - joints and links
Joints - 1, 2, or 3 Degree of Freedom
Joints - rotational or prismatic
Links - displayable objects
Pose - setting parameters for all joint DoFs
Pose Vector - a complete set of joint parameters
© M. Gokturk 60
© M. Gokturk 61
T
data
R
S
Forward Kinematics
© M. Gokturk 62
T1.1 T2.1
T1.2 T2.2
T0
R2.2R1.2
R2.1R1.1
User modifiesRotation(new “pose vector”)
Re-traverse treeTo get new “pose”
Transformations at the arcs
© M. Gokturk 63
Forward KinematicsDescribes the positions of the body parts as a function of the joint angles.
1 DOF: knee1 DOF: knee 2 DOF: wrist2 DOF: wrist 3 DOF: arm3 DOF: arm
© M. Gokturk 64
q
Degree of FreedomDOF
Joint Limits
Joint Representation
© M. Gokturk 65
Degrees of Freedom
Joint Limits
Multiple
qy
w
gimbal lock
Axis-anglequaternions
Joint Representation
© M. Gokturk 66
Note
User interface representation may not be the same used for internal representation and operations
qy
w
Joint Representation
© M. Gokturk 67
© M. Gokturk 68
Drawing Articulated Figure
© M. Gokturk 69
© M. Gokturk 70
© M. Gokturk 71
© M. Gokturk 72
Standard method of describing relationship of one DOF to next
Used extensively in robotics
Used in some early animation systems
Multiple DOF joints represented by zero-length parameters
Denavit and Hartenberg
© M. Gokturk 73
© M. Gokturk 74
© M. Gokturk 75
© M. Gokturk 76
© M. Gokturk 77
© M. Gokturk 78
© M. Gokturk 79
Skeleton Hierarchy
hips
r-thigh
r-calf
r-foot
left-leg ...
Each bone transformation described relative to the parent in the hierarchy:
, , , , ,h h h h h hx y z q f s
, ,t t tq f s
cq
,ffq f
© M. Gokturk 80
Forward Kinematics
vs
y
x
z
w =vsv( , )
ffq fTR( )cqTR( , , )
t t tq f sTR( , , ) ( , , )
h h h h h hx y z q f sT R
vsvs
Transformation matrix for a sensor/effecter vs is a matrix composition of all joint transformation between the sensor/effecter and the root of the hierarchy.
w hv = x , , , , , , , , , , , =h h h h h t t t c ff s sy z v vp
S S p
, , , , ,h h h h h hx y z q f s
, ,t t tq f s
cq
,ffq f
© M. Gokturk 81
Example (1) : Manipulator + 3 Revolute Joints
© M. Gokturk 82
Example (2) : (1) + Ball-and-Socket Joint
© M. Gokturk 83
• Four link deep appendage with a branch after the second link
• The first and third links have two degrees of freedom, the others have one.
• The first frame is defined by rotation angles ((0,0),0,[(30,0),-15],[(-30,0),15]
• The last frame is defined by rotation angles ((-30,60),-80,[(90,30),-135],[(-90,30),135]
© M. Gokturk 84
© M. Gokturk 85
© M. Gokturk 86
© M. Gokturk 87
© M. Gokturk 88
© M. Gokturk 89
© M. Gokturk 90
Summary