Quaternions and Rotations

Similar documents
Quaternions and Rotations

12.1 Quaternions and Rotations

Quaternions and Rotations

Quaternions and Rotations

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations

Animation. Itinerary. What is Animation? What is Animation? Animation Methods. Modeling vs. Animation Computer Graphics Lecture 22

Animation. Itinerary Computer Graphics Lecture 22

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Quaternions & Rotation in 3D Space

3D Kinematics. Consists of two parts

CS354 Computer Graphics Rotations and Quaternions

3D Rotation: more than just a hobby

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander

Introduction to quaternions. Mathematics. Operations

Visual Recognition: Image Formation

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

Computer Animation II

Transformations Week 9, Lecture 18

Inertial Measurement Units II!

Orientation & Quaternions

CS184: Using Quaternions to Represent Rotation

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

Lecture Note 3: Rotational Motion

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

CS612 - Algorithms in Bioinformatics

Visualizing Quaternions

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

CS770/870 Spring 2017 Quaternions

Animation and Quaternions

Quaternions and Euler Angles

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Animations. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Kavita Bala

Rotations in 3D Graphics and the Gimbal Lock

Part II: OUTLINE. Visualizing Quaternions. Part II: Visualizing Quaternion Geometry. The Spherical Projection Trick: Visualizing unit vectors.

Autonomous Navigation for Flying Robots

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Quaternion properties: addition. Introduction to quaternions. Quaternion properties: multiplication. Derivation of multiplication

Motion Capture. Motion Capture in Movies. Motion Capture in Games

CMSC 425: Lecture 6 Affine Transformations and Rotations

IMAGE-BASED RENDERING AND ANIMATION

Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Transformations: 2D Transforms

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b

Quaternion to Euler Angle Conversion for Arbitrary Rotation Sequence Using Geometric Methods

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

Aalto CS-C3100 Computer Graphics, Fall 2016

Kinematics and Orientations

Quaternion Rotations AUI Course Denbigh Starkey

Chapter 3 : Computer Animation

Articulated Characters

Rotation with Quaternions

1 Historical Notes. Kinematics 5: Quaternions

Why animate humans? Why is this hard? Aspects of the Problem. These lectures. Animation Apreciation 101

Animation. Traditional Animation Keyframe Animation. Interpolating Rotation Forward/Inverse Kinematics

Quaternions. Mike Bailey. A Useful Concept: Spherical Linear Interpolation. sin(1 t) sin t

Lab 2A Finding Position and Interpolation with Quaternions

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

animation computer graphics animation 2009 fabio pellacini 1

QUATERNIONS AND ROTATIONS

Reading. Topics in Articulated Animation. Character Representation. Animation. q i. t 1 t 2. Articulated models: Character Models are rich, complex

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

3D Transformations and Complex Representations. Computer Graphics CMU /15-662, Fall 2016

Quaternions: From Classical Mechanics to Computer Graphics, and Beyond

Kinematical Animation.

MTRX4700 Experimental Robotics

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

Introduction to Robotics

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

3D Rotations and Complex Representations. Computer Graphics CMU /15-662, Fall 2017

Geometric Transformations

Rotation and Orientation: Fundamentals. Perelyaev Sergei VARNA, 2011

Advanced Computer Graphics Transformations. Matthias Teschner

CS230 : Computer Graphics Lecture 12: Introduction to Animation. Tamar Shinar Computer Science & Engineering UC Riverside

Animation Curves and Splines 2

EEE 187: Robotics Summary 2

Keyframe Animation. Animation. Computer Animation. Computer Animation. Animation vs Modeling. Animation vs Modeling

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Fundamentals of 3D. Lecture 3: Debriefing: Lecture 2 Rigid transformations Quaternions Iterative Closest Point (+Kd-trees)

METR 4202: Advanced Control & Robotics

Quaternions and Exponentials

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Retargetting Motion to New Characters. Project Report Xin LI

Fundamentals of Computer Animation

Inverse Kinematics Programming Assignment

CS5620 Intro to Computer Graphics

Transformations. CSCI 420 Computer Graphics Lecture 4

Human body animation. Computer Animation. Human Body Animation. Skeletal Animation

Fundamentals of Computer Animation

Data-driven Approaches to Simulation (Motion Capture)

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Kinematic Synthesis. October 6, 2015 Mark Plecnik

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Animation. CS 465 Lecture 22

Animation. CS 4620 Lecture 19. Cornell CS4620 Fall 2013 Lecture Steve Marschner (with previous instructors James/Bala)

PSE Game Physics. Session (3) Springs, Ropes, Linear Momentum and Rotations. Oliver Meister, Roland Wittmann

Animation. Animation

Transcription:

CSCI 480 Computer Graphics Lecture 20 and Rotations April 6, 2011 Jernej Barbic Rotations Motion Capture [Ch. 4.12] University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s11/ 1 Rotations Very important in computer animation and robotics Joint angles, rigid body orientations, camera parameters 2D or 3D 2 Rotations in Three Dimensions Orthogonal matrices: RR T = R T R = I det(r) = 1 Representing Rotations in 3D in 3D have essentially three parameters Axis + angle (2 DOFs + 1DOFs) How to represent the axis? Longitude / lattitude have singularities 3x3 matrix 9 entries (redundant) 3 4 Representing Rotations in 3D Euler Angles Euler angles roll, pitch, yaw no redundancy (good) gimbal lock singularities generally considered the best representation redundant (4 values), but only by one DOF (not severe) stable interpolations of rotations possible 1. Yaw rotate around y-axis 2. Pitch rotate around (rotated) x-axis 3. Roll rotate around (rotated) z-axis 5 6 1

Gimbal Lock When all three gimbals are lined up (in the same plane), the system can only move in two dimensions from this configuration, not three, and is in gimbal lock. Outline 7 8 Generalization of complex numbers Invented by Hamilton in 1843 in Dublin, Ireland Three imaginary numbers: i, j, k i 2 = -1, j 2 = -1, k 2 = -1, ij = k, jk = i, ki = j, ji = -k, kj = -i, ik = -j q = s + x i + y j + z k, s,x,y,z are scalars 9 Here as he walked by on the 16th of October 1843 Sir William Rowan Hamilton in a flash of genius discovered the fundamental formula for quaternion multiplication i 2 = j 2 = k 2 = i j k = 1 & cut it on a stone of this bridge 10 are not commutative! q 1 q 2 q 2 q 1 However, the following hold: (q 1 q 2 ) q 3 = q 1 (q 2 q 3 ) (q 1 + q 2 ) q 3 = q 1 q 3 + q 2 q 3 q 1 (q 2 + q 3 ) = q 1 q 2 + q 1 q 3 α (q 1 + q 2 ) = α q 1 + α q 2 (α is scalar) (αq 1 ) q 2 = α (q 1 q 2 ) = q 1 (αq 2 ) (α is scalar) Exercise: multiply two quaternions (2 - i + j + 3k) (-1 + i + 4j - 2k) =... I.e. all usual manipulations are valid, except cannot reverse multiplication order. 11 12 2

Quaternion Properties q = s + x i + y j + z k Norm: q 2 = s 2 + x 2 + y 2 + z 2 Conjugate quaternion: q = s - x i - y j - z k and Rotations are represented by unit quaternions q = s + x i + y j + z k s 2 + x 2 + y 2 + z 2 = 1 Inverse quaternion: q -1 = q / q 2 Unit quaternion: q =1 Inverse of unit quaternion: q -1 = q 13 Unit quaternion sphere (unit sphere in 4D) Source: Wolfram Research unit sphere in 4D 14 Rotations to Unit Let (unit) rotation axis be [u x, u y, u z ], and angle θ Corresponding quaternion is q = cos(θ/2) + sin(θ/2) u x i + sin(θ/2) u y j + sin(θ/2) u z k Composition of rotations q 1 and q 2 equals q = q 2 q 1 3D rotations do not commute! Unit to Rotations Let v be a (3-dim) vector and let q be a unit quaternion Then, the corresponding rotation transforms vector v to q v q -1 (v is a quaternion with scalar part equaling 0, and vector part equaling v) For q = a + b i + c j + d k R = 15 16 q and -q give the same rotation! Other than this, the relationship between rotations and quaternions is unique Quaternion Interpolation Better results than Euler angles A quaternion is a point on the 4-D unit sphere interpolating rotations requires a unit Source: Wolfram Research quaternion at each step -- another point on the 4-D sphere move with constant angular velocity along the great circle between the two points Spherical Linear interpolation (SLERPing) Any rotation is given by 2 quaternions, so pick the shortest SLERP 17 18 3

Quaternion Interpolation To interpolate more than two points: solve a non-linear variational constrained optimization (numerically) Outline Further information: Ken Shoemake in the SIGGRAPH '85 proceedings (Computer Graphics, V. 19, No. 3, P.245) 19 20 What is Motion Capture? Motion capture is the process of tracking reallife motion in 3D and recording it for use in any number of applications. Why Motion Capture? Keyframes are generated by instruments measuring a human performer they do not need to be set manually The details of human motion such as style, mood, and shifts of weight are reproduced with little effort 21 22 Mocap Technologies: Optical Facial Motion Capture Multiple high-resolution, high-speed cameras Light bounced from camera off of reflective markers High quality data Markers placeable anywhere Lots of work to extract joint angles Occlusion Which marker is which? (correspondence problem) 120-240 Hz @ 1Megapixel 23 24 4

Mocap Technologies: Electromagnetic Sensors give both position and orientation No occlusion or correspondence problem Little post-processing Limited accuracy Mocap Technologies: Exoskeleton Really Fast (~500Hz) No occlusion or correspondence problem Little error Movement restricted Fixed sensors 25 26 Motion Capture Why not? Difficult for non-human characters Can you move like a hamster / duck / eagle? Can you capture a hamster s motion? Actors needed Which is more economical: Paying an animator to place keys Hiring a Martial Arts Expert When to use Motion Capture? Complicated character motion Where uncomplicated ends and complicated begins is up to question A walk cycle is often more easily done by hand A Flying Monkey Kick might be worth the overhead of mocap Can an actor better express character personality than the animator? 27 28 Summary 29 5