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

Transformations Week 9, Lecture 18

Visual Recognition: Image Formation

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

Computer Animation II

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

Quaternions and Euler Angles

Animation and Quaternions

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

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

Transformations: 2D Transforms

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

Aalto CS-C3100 Computer Graphics, Fall 2016

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

Kinematics and Orientations

Chapter 3 : Computer Animation

Quaternion Rotations AUI Course Denbigh Starkey

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

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

Lab 2A Finding Position and Interpolation with Quaternions

animation computer graphics animation 2009 fabio pellacini 1

QUATERNIONS AND ROTATIONS

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

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

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

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

Kinematical Animation.

Quaternions: From Classical Mechanics to Computer Graphics, and Beyond

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

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

MTRX4700 Experimental Robotics

Introduction to Robotics

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

Geometric Transformations

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

Transformations. CSCI 420 Computer Graphics Lecture 4

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

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

CS5620 Intro to Computer Graphics

Fundamentals of Computer Animation

Human body animation. Computer Animation. Human Body Animation. Skeletal 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

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

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

Inverse Kinematics Programming Assignment

Animation. Animation

Transcription:

CSCI 420 Computer Graphics Lecture 20 and Rotations Rotations Motion Capture [Angel Ch. 3.14] Rotations Very important in computer animation and robotics Joint angles, rigid body orientations, camera parameters 2D or 3D Jernej Barbic University of Southern California 1 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 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 Euler Angles 1. Yaw rotate around y-axis 2. Pitch rotate around (rotated) x-axis 3. Roll rotate around (rotated) y-axis 5 6 1

Gimbal Lock 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. 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. 7 8 Outline Generalization of complex numbers 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 10 Invented by Hamilton in 1843 in Dublin, Ireland are not commutative! 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. 11 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) I.e. all usual manipulations are valid, except cannot reverse multiplication order. 12 2

Exercise: multiply two quaternions (2 - i + j + 3k) (-1 + i + 4j - 2k) =... 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 Inverse quaternion: q -1 = q / q 2 Unit quaternion: q =1 Inverse of unit quaternion: q -1 = q 13 14 and Rotations are represented by unit quaternions q = s + x i + y j + z k s 2 + x 2 + y 2 + z 2 = 1 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 Unit quaternion sphere (unit sphere in 4D) Source: Wolfram Research unit sphere in 4D 15 Composition of rotations q 1 and q 2 equals q = q 2 q 1 3D rotations do not commute! 16 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) q and -q give the same rotation! Other than this, the relationship between rotations and quaternions is unique For q = a + b i + c j + d k R = 17 18 3

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 Quaternion Interpolation To interpolate more than two points: solve a non-linear variational constrained optimization (numerically) Further information: Ken Shoemake in the SIGGRAPH '85 proceedings (Computer Graphics, V. 19, No. 3, P.245) 19 20 Outline 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. 21 22 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 Mocap Technologies: Optical 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

Facial Motion Capture Mocap Technologies: Electromagnetic Sensors give both position and orientation No occlusion or correspondence problem Little post-processing Limited accuracy 25 26 Mocap Technologies: Exoskeleton Really Fast (~500Hz) No occlusion or correspondence problem Little error Movement restricted 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 Fixed sensors 27 28 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? Summary 29 30 5