3D orientation.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
3D Kinematics Eric Whitman 1/24/2010. Rigid Body State: 2D p.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
Orientation & Quaternions
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
3D Coordinate Systems and Transformations Revision 1
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
Quaternions CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Rotation representation and Interpolation
Orientations Goal: –Convenient representation of orientation of objects & characters in a scene Applications to: – inverse kinematics –rigid body simulation.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Technical Background.
CS 445 / 645 Introduction to Computer Graphics Lecture 21 Representing Rotations Lecture 21 Representing Rotations.
An Introduction to Robot Kinematics
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
1 Kinematics ( 運動學 ) Primer Jyun-Ming Chen Fall 2009.
Visualizing Orientation using Quaternions Gideon Ariel; Rudolf Buijs; Ann Penny; Sun Chung.
Mathematical Fundamentals
Rotations and Translations
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
3D Kinematics Consists of two parts 3D rotation 3D translation  The same as 2D 3D rotation is more complicated than 2D rotation (restricted to z- axis)
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Transformation of Graphics
Computer Graphics Bing-Yu Chen National Taiwan University.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16.
2D Transformation of Graphics
Dx = 2 dy = 3 Y X D Translation A translation is applied to an object by repositioning it along a straight-line path.
Rotations and Translations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
Advanced Computer Graphics Spring 2014
1 Fundamentals of Robotics Linking perception to action 2. Motion of Rigid Bodies 南台科技大學電機工程系謝銘原.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Rotations and Quaternions Week 9, Wed 29 Oct 2003.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Animating Rotations and Using Quaternions. What We’ll Talk About Animating Translation Animating 2D Rotation Euler Angle representation 3D Angle problems.
Rotation and Orientation: Fundamentals Jehee Lee Seoul National University.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
What is Kinematics. Kinematics studies the motion of bodies.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
Affine Geometry.
Euler Angles This means, that we can represent an orientation with 3 numbers Assuming we limit ourselves to 3 rotations without successive rotations about.
Computer Graphics I, Fall 2010 Transformations.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
Fundamentals of Computer Animation Orientation and Rotation.
Computer Animation Algorithms and Techniques
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
Computer Graphics Transformations.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Computer Graphics Transformations.
3D Transformations Source & Courtesy: University of Wisconsin,
Rotations and Quaternions Week 9, Wed 29 Oct 2003
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
(c) University of Wisconsin, CS559
UMBC Graphics for Games
CS-378: Game Technology Lecture #2: Transformations Prof. Okan Arikan
Geometric Objects and Transformations (II)
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Rotation and Orientation: Fundamentals
Presentation transcript:

3D orientation

Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map

Joints and rotations Rotational DOFs are widely used in character animation 3 translational DOFs 48 rotational DOFs 1.Rotation is the most important transformation in hierarchical modeling. 2.The rotations in a human model is represented by joints. 3.Different joint has different numbers of DOFs 4.The 3DOFs rotation is not organized in a simple 3 dimensional vector space Each joint can have up to 3 DOFs 1 DOF: knee 2 DOF: wrist 3 DOF: arm

Representation of orientation Homogeneous coordinates (review) 4X4 matrix used to represent translation, scaling, and rotation a point in the space is represented as Treat all transformations the same so that they can be easily combined since all the transformations are represented in the same way, we can combined those transformation together by simply multiplying the matrices

Translation translation matrix new point old point

Scaling new point scaling matrix old point

Rotation X axis Y axis The rows and columns are orthonormal Z axis

Composite transformations A series of transformations on an object can be applied as a series of matrix multiplications : position in the global coordinate : position in the local coordinate

Interpolation In order to “move things”, we need both translation and rotation Interpolating the translation is easy, but what about rotations?

Motivation Finding the most natural and compact way to present rotation and orientations Orientation interpolation which result in a natural motion A closed mathematical form that deals with rotation and orientations (expansion for the complex numbers)

Rotation Matrix A general rotation can be represented by a single 3x3 matrix Length Preserving (Isometric) Reflection Preserving Orthonormal

Fixed Angle Representation Angles used to rotate about fixed axes Orientations are specified by a set of 3 ordered parameters that represent 3 ordered rotations about fixed axes, ie. first about x, then y, then z Many possible orderings, don’t have to use all 3 axes, but can’t do the same axis back to back

Fixed Angle Representation A rotation of 10,45, 90 would be written as Rz(90) Ry(45), Rx(10) since we want to first rotate about x, y, z. It would be applied then to the point P…. RzRyRx P Problem occurs when two of the axes of rotation line up on top of each other. This is called “Gimbal Lock”

Gimbal Lock A 90 degree rotation about the y axis essentially makes the first axis of rotation align with the third. Incremental changes in x,z produce the same results – you’ve lost a degree of freedom

Gimbal Lock Phenomenon of two rotational axis of an object pointing in the same direction. Simply put, it means your object won't rotate how you think it ought to rotate.

Interpolation of orientation How about interpolating each entry of the rotation matrix? The interpolated matrix might no longer be orthonormal, leading to nonsense for the in- between rotations

Interpolation of orientation Example: interpolate linearly from a positive 90 degree rotation about y axis to a negative 90 degree rotation about y Linearly interpolate each component and halfway between, you get this...

Properties of rotation matrix Easily composed? Interpolate?

Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map

Fixed angle Angles used to rotate about fixed axes Orientations are specified by a set of 3 ordered parameters that represent 3 ordered rotations about fixed axes Many possible orderings We represent orientation using angles that rotate about fixed axes x(90)y(90) is different from y(90)x(90)

Fixed angle A rotation of Rz(90)Ry(60)Rx(30) looks like http://www.arielnet.com/adi2001/demos/007/gimballock.asp

Euler angle Same as fixed angles, except now the axes move with the object An Euler angle is a rotation about a single Cartesian axis Create multi-DOF rotations by concatenating Euler angles evaluate each axis independently in a set order book example

Euler angle vs. fixed angle Rz(90)Ry(60)Rx(30) = Ex(30)Ey(60)Ez(90) Euler angle rotations about moving axes written in reverse order are the same as the fixed axis rotations What is the relation between Euler and fixed angles? Z Y X

Gimbal Lock (again!) Rotation by 90o causes a loss of a degree of freedom x y z 1 /2 x’ 3

Gimbal Lock Phenomenon of two rotational axis of an object pointing in the same direction. Simply put, it means your object won't rotate how you think it ought to rotate.

Gimbal Lock A Gimbal is a hardware implementation of Euler angles used for mounting gyroscopes or expensive globes Gimbal lock is a basic problem with representing 3D rotation using Euler angles or fixed angles

Gimbal lock When two rotational axis of an object point in the same direction, the rotation ends up losing one degree of freedom http://www.arielnet.com/adi2001/demos/007/gimballock.asp

Properties of Euler angle Easily composed? Interpolate? How about joint limit? What seems to be the problem? no, Eucleadian , yes, singularity single rotation interpolates, but compound rotation doesn’t spinning about each axis successively, the result of the compound orientation will look awful

Euler Angles A general rotation is a combination of three elementary rotations: around the x-axis (x-roll) , around the y-axis (y-roll) and around the z-axis (z-roll).

Euler Angles

Euler Angles and Rotation Matrices

Euler angles interpolation z x y π x-roll π R(0,0,0),…,R(t,0,0),…,R(,0,0) t[0,1] y z x z-roll π π y-roll π R(0,0,0),…,R(0,t, t),…,R(0,, )

Euler Angles Interpolation Unnatural movement !

Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map

Goal Find a parameterization in which a simple steady rotation exists between two key orientations moves are independent of the choice of the coordinate system

Axis angle Represent orientation as a vector and a scalar vector is the axis to rotate about scalar is the angle to rotate by

Angle and Axis Any orientation can be represented by a 4-tuple angle, vector(x,y,z) where the angle is the amount to rotate by and the vector is the axis to rotate about Can interpolate the angle and axis separately No gimbal lock problems! But, can’t efficiently compose rotations…must convert to matrices first!

Angular displacement (,n) defines an angular displacement of  about an axis n

Properties of axis angle Can avoid Gimbal lock. Why? Can interpolate the vector and the scalar separately. How? euler angle representation separates the orientation into three steps, which introduce the chances that the last rotational axis overlap with the first axis axis angle representation does everything in one rotation and there is no ordering issue

Axis angle interpolation if you sweep A1 on this plan to A2, you are essentially doing the interpolation between two vectors

Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map

Quaternion 4 tuple of real numbers: scalar vector Quaternion is originally represented as an extended complex number. Hamilton first defined quaternion using four real number. Geometrically, quaternion can not be easily organized in Euaclidean space. We need to define different algebraic rules for quaternions from the regular vector algebra v and the rotating axis r are related by sin(theta/2) Same information as axis angles but in a different form

Quaternions ? Extend the concept of rotation in 3D to 4D. Avoids the problem of "gimbal-lock" and allows for the implementation of smooth and continuous rotation. In effect, they may be considered to add a additional rotation angle to spherical coordinates ie. Longitude, Latitude and Rotation angles A Quaternion is defined using four floating point values |x y z w|. These are calculated from the combination of the three coordinates of the rotation axis and the rotation angle.

How do quaternions relate to 3D animation? Solution to "Gimbal lock" Instead of rotating an object through a series of successive rotations, a quaternion allows the programmer to rotate an object through a single arbitary rotation axis. Because the rotation axis is specifed as a unit direction vector, it may be calculated through vector mathematics or from spherical coordinates ie (longitude/latitude). Quaternions interpolation : smooth and predictable rotation effects.

Quaternion to Rotation Matrix

Quaternions Definition Extension of complex numbers 4-tuple of real numbers s,x,y,z or [s,v] s is a scalar v is a vector Same information as axis/angle but in a different form Can be viewed as an original orientation or a rotation to apply to an object

Quaternions Math

Quaternions properties The conjugate and magnitude are similar to complex numbers Quaternions are non commutative q1 = (s1,v1) q2 = (s2,v2) q1*q2 = (s1s2 – v1.v2 , s1v2 + s2v1 + v1 x v2) inverse: unit quaternion:

Quaternion Rotation To rotate a vector, v using quaternion math represent the vector as [0,v] represent the rotation as a quaternion, q

Quaternions as Rotations Rotation of P=(0,r) about the unit vector n by an angle θ using the unit quaternion q=(s,v) but q=(cos½θ, sin½θ•n) where |n|=1

Quaternions as Rotations Concatenating rotations – rotate using q1 and then using q2 is like rotation using q2*q1

Quaternion math Unit quaternion Multiplication

Quaternion math Conjugate Inverse the unit length quaternion

Quaternion Rotation If is a unit quaternion and then results in rotating about by proof: see Quaternions by Shoemaker

Quaternion Rotation

Quaternion composition If and are unit quaternion the combined rotation of first rotating by and then by is equivalent to

Matrix form

Quaternion interpolation 2-angle rotation can be represented by a unit sphere 1-angle rotation can be represented by a unit circle there is a way that helps us to visualize the interpolation of quaternion all the possible 1D orientation can be located on a circle Interpolation means moving on n-D sphere Now imagine a 4-D sphere for 3-angle rotation

Quaternion interpolation Moving between two points on the 4D unit sphere a unit quaternion at each step - another point on the 4D unit sphere move with constant angular velocity along the great circle between the two points on the 4D unit sphere

Quaternion interpolation Direct linear interpolation does not work Linearly interpolated intermediate points are not uniformly spaced when projected onto the circle Spherical linear interpolation (SLERP) Normalize to regain unit quaternion

Rotations in Reality It’s easiest to express rotations in Euler angles or Axis/angle We can convert to/from any of these representations Choose the best representation for the task input:Euler angles interpolation: quaternions composing rotations: quaternions, orientation matrix

Rotation matrix Fixed angle and Euler angle Axis angle Quaternion Exponential map

Exponential map Represent orientation as a vector direction of the vector is the axis to rotate about magnitude of the vector is the angle to rotate by Zero vector represents the identity rotation

Properties of exponential map No need to re-normalize the parameters Fewer DOFs Good interpolation behavior Singularities exist but can be avoided

Choose a representation Choose the best representation for the task input: joint limits: interpolation: compositing: rendering: Euler angles Euler angles, quaternion (harder) quaternion or exponential map quaternions or orientation matrix orientation matrix ( quaternion can be represented as matrix as well)