REFERENCE: QUATERNIONS/ Ogre Transformations.

Slides:



Advertisements
Similar presentations
Complex Numbers.
Advertisements

Chapter 5 Section 4: Complex Numbers. VOCABULARY Not all quadratics have real- number solutions. For instance, x 2 = -1 has no real-number solutions because.
John C. Hart CS 318 Interactive Computer Graphics
3D Kinematics Eric Whitman 1/24/2010. Rigid Body State: 2D p.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
3D Coordinate Systems and Transformations Revision 1
3-D Geometry.
3D orientation.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Complex Numbers? What’s So Complex?. Complex numbers are vectors represented in the complex plane as the sum of a Real part and an Imaginary part: z =
Rotation representation and Interpolation
Orientations Goal: –Convenient representation of orientation of objects & characters in a scene Applications to: – inverse kinematics –rigid body simulation.
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.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 3.1: 3D Geometry Jürgen Sturm Technische Universität München.
Copyright © Cengage Learning. All rights reserved.
Sec 3.4 & Sec 3.5 Complex Numbers & Complex Zeros
Section 2.2 The Complex Numbers.
Complex Numbers Introduction.
1 Kinematics ( 運動學 ) Primer Jyun-Ming Chen Fall 2009.
Rotations and Translations
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)
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Representing Transformations, The TRANSF Package Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday,
3D Computer Graphics An oh so brief introduction.
Rotations and Translations
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.
Maths and Technologies for Games Quaternions CO3303 Week 1.
Advanced Computer Graphics Spring 2014
1 Complex Numbers Digital Lesson. 2 Definition: Complex Number The letter i represents the numbers whose square is –1. i = Imaginary unit If a is a positive.
3D Kinematics Consists of two parts
1 Scene Graphs Week 4.2 ©Anthony Steed
Rotation and Orientation: Fundamentals Jehee Lee Seoul National University.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
4.6 Perform Operations With Complex Numbers. Vocabulary: Imaginary unit “i”: defined as i = √-1 : i 2 = -1 Imaginary unit is used to solve problems that.
1 What you will learn  Lots of vocabulary!  A new type of number!  How to add, subtract and multiply this new type of number  How to graph this new.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
Quaternion 靜宜大學資工系 蔡奇偉副教授 大綱  History of Quaternions  Definition of Quaternion  Operations  Unit Quaternion  Operation Rules  Quaternion Transforms.
3D Geometric Transformation
This Week WeekTopic Week 1 Coordinate Systems, Basic Functions Week 2 Trigonometry and Vectors (Part 1) Week 3 Vectors (Part 2) Week 4 Vectors (Part 3:
Euler Angles This means, that we can represent an orientation with 3 numbers Assuming we limit ourselves to 3 rotations without successive rotations about.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
Chapter 4 Section 8 Complex Numbers Objective: I will be able to identify, graph, and perform operations with complex numbers I will be able to find complex.
1 Dr. Scott Schaefer Quaternions and Complex Numbers.
Lesson 1.8 Complex Numbers Objective: To simplify equations that do not have real number solutions.
EE 495 Modern Navigation Systems Navigation Mathematics Rotation Matrices – Part II Wednesday, Jan 14 EE 495 Modern Navigation Systems Slide 1 of 21.
Complex Numbers C.A-1.5. Imaginary numbers i represents the square root of – 1.
Fundamentals of Computer Animation Orientation and Rotation.
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
Transformations Review 4/18/2018 ©Babu 2009.
Computer Animation Algorithms and Techniques
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
3D Geometric Transformation
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Ogre Overview Lecture 3.
Introduction to Complex Numbers
Rotation representation and Interpolation
Conjugates Standard form of Complex Numbers
UMBC Graphics for Games
VIRTUAL ENVIRONMENT.
4.6 Complex Numbers Algebra II.
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Complex Numbers MAΘ
Presentation transcript:

REFERENCE: QUATERNIONS/ Ogre Transformations

Overview Most of this lecture will be about (Ogre) SceneNodes  What are they?  How do we set up a scene graph?  How do we transform a scene node?

SceneGraph Made up of SceneNodes Goals:  Frustrum calling  Limit the number of material swaps  Hierarchical Transformations

SceneNodes can hold MoveableObject’s Lots of things are derived from MoveableObject:  Entities  Lights  ParticleEmitters  Billboards …… SceneManager::create___  Optional unique name (string)  SceneManager::get____  SceneManager::destroy___  Don’t forget SceneNode::detach before doing this. MoveableObject::getParentSceneNode()

SceneNode class Attributes:  Pointer to parent and children scene nodes.  Pointers to attached objects  A 3x4 transformation matrix: from the parent. Rendering the graph  Depth-first traversal  Matrix concatenation  Override with SceneNode::setInheritXXX(bool) (orientation or scale) Set up the scene graph with:  SceneNode::createChildSceneNode  SceneNode::addChild(Node *)  SceneNode::removeChild(Node *) To set / modify a scene node's matrix, you normally call methods.  Translation and scaling are pretty easy  Rotations (and orientations) require Quaternions… …so let's get this out of the way.

Quaternions Discovered by Hamilton in 1843 Originally to visualize complex numbers (a 2d plane), but we can extend it to 3d. (in Dublin, Ireland)

Complex numbers If you want to solve x^2 + 1 = 0, you’ll attempt to take the square root of a negative number.  Not possible!  …but mathematicians invented a fictional quantity I  i^2 = -1 A complex number is of the form  z = a + bi  Real numbers have b = 0  Imaginary numbers have a = 0

Complex numbers operations Adding complex numbers  (a + bi) + (c + di) = (a + c) + (b + d)i Subtracting complex numbers  (a + bi) – (c + di) = (a – c) + (b – d)i Complex * scalar  k (a + bi) = ka + kbi Complex * Complex  (a + bi) (c + di) = (ac – bd) + (ad + bc)i Complex 2  (a + bi) * (a + bi) = (a 2 – b 2 ) + 2abi Complex Conjugate  (a + bi)* = (a – bi)  (a + bi) (a + bi)* = a 2 + b 2

Powers of i … i -5 = -i i -4 = 1 i -3 = i i -2 = -1 i -1 = -i i 0 = 1 i 1 = i i 2 = -1 i 3 = -i i 4 = 1 i 5 = i i 6 = -1 … See a pattern? i n = rot(90 0 * n) on the real / imaginary plane …extending that… Taking a point on the complex plane and multiplying by i rotates it 90 degrees. Real Imaginary

An example Real Imaginary

Arbitrary Rotations

Now to 3D!

Quaternion Operations

A Quaternion "rotation"

Quaternion rotation

SLERP-ing

Comparison to other rotation methods Rotation Matrices  Not very easy to interpolate Euler angles  A series of rotations about the cardinal (world) axes  Can lead to gimbal lock  Hard to visualize, but happens in games – the camera is rotating smoothly, but suddenly flips. We can convert each of these back & forth between quaternions.

Quaternions in Ogre Several constructors. The main one:  Quaternion(Radian r, Vector3 axis);  e.g Quaternion(Radian(3.14), Vector3(0,1,0));  Quaternion(Degree(45), Vector3(0,1,0)); Slerping:  Quaternion::slerp(Real t, const Quaternion & Q, const Quaternion & P, bool shortest_path=false); Useful methods:  Use * operator for multiplication.  Quaternion UnitInverse() const  Vector3 xAxis()  Real normalise();

Transformation methods (of Node class) Adjusting  translate(const Vector3 & offset, Node::TransformSpace space)  space can be one of: Node::TS_LOCAL, Node::TS_PARENT, Node::TS_WORLD.  rotate(const Quaternion & q, Node::TransformSpace space)  Also, pitch, yaw, and roll methods.  scale(const Vector3 & factor); Setting (all are relative to parent  setPosition(const Vector3 & pos);  setScale(const Vector3 & factor)  setOrientation(const Quaternion & q); Conversion  Quaternion convertLocalToWorldOrientation(const Quaternion & local);  Quaternion convertWorldToLocalOrientation(const Quaternion & world);  // Similar functions for Position (but not scale).

Some interesting scene node setups Gimbals: e.g. for our camera control  [Describe] [more to be added later]