Orientation3D in Three.JS

Slides:



Advertisements
Similar presentations
John C. Hart CS 318 Interactive Computer Graphics
Advertisements

Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
3D Graphics for Game Programming (J. Han) Chapter XI Character Animation.
Chris Hall Aerospace and Ocean Engineering
Computer graphics & visualization Key frame Interpolation.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
Jinxiang Chai CSCE441: Computer Graphics Coordinate & Composite Transformations 0.
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
3D Coordinate Systems and Transformations Revision 1
3-D Geometry.
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.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Measuring 3 rd Euler Angle 1 st : Rotate around Z Axis by Phi 2 nd : Rotate around Y' Axis by Theta. 3 rd : Measure angle from X' axis to the Decay Particle.
Midterm Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
University of British Columbia © MIchiel van de Panne An Introduction to Computer Animation Michiel van de Panne.
Rotation representation and Interpolation
Rotation and Orientation: Affine Combination Jehee Lee Seoul National University.
Euler Angles. Three Angles  A rotation matrix can be described with three free parameters. Select three separate rotations about body axesSelect three.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Technical Background.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
Lecture Fall 2001 Computer Animation Fundamentals Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
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.
This Week Week Topic Week 1 Week 2 Week 3 Week 4 Week 5
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16.
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.
1 CS 430/536 Computer Graphics I 3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov.
1 Homogeneous Transformation Ref: Richard Paul Chap. 1.
Advanced Computer Graphics Spring 2014
1 Fundamentals of Robotics Linking perception to action 2. Motion of Rigid Bodies 南台科技大學電機工程系謝銘原.
3D Kinematics Consists of two parts
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Kinematics Primer Jyun-Ming Chen. Contents General Properties of Transform 2D and 3D Rigid Body Transforms Representation Computation Conversion … Transforms.
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.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
Quaternionic Splines of Paths Robert Shuttleworth Youngstown State University Professor George Francis, Director illiMath2001 NSF VIGRE REU UIUC-NCSA.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
Comparing Two Motions Jehee Lee Seoul National University.
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.
1 Dr. Scott Schaefer Quaternions and Complex Numbers.
Quaternionic Splines of Paths Robert Shuttleworth Youngstown State University Professor George Francis, Director illiMath2001 NSF VIGRE REU UIUC-NCSA.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Advanced Math.
Jinxiang Chai CSCE441: Computer Graphics Coordinate & Composite Transformations 0.
REFERENCE: QUATERNIONS/ Ogre Transformations.
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.
Computer Animation Algorithms and Techniques
Review: 3D Transforms Continued
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
3D Kinematics Consists of two parts
UW Extension Certificate Program in Game Development 2nd quarter: Advanced Graphics Animation.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
UMBC Graphics for Games
CSCE441: Computer Graphics 2D/3D Transformations
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Rotation and Orientation: Affine Combination
Rotation and Orientation: Fundamentals
Emerging Technologies for Games Review & Revision Strategy
Presentation transcript:

Orientation3D in Three.JS

Content Specifying orientations Interpolating orientations Euler angles Axis angle Matrix4 Interpolating orientations quaternion Fall 2016

Base Code http://jsfiddle.net/game3js/teudshx5/ // axis-symmetric objects function buildMissle() { //… } // general 3D objects function buildPlane() { //… } Fall 2016

Object3D Related Properties/Methods .position .rotation .quaternion .matrix .matrixAutoUpdate .rotateOnAxis (axis,angle) .updateMatrix() Reference: https://threejs.org/docs/manual/introduction/Matrix-transformations.html Fall 2016

3D Orientations Setting: use Euler angles Axis angle Rotation matrix Interpolating: use quaternion Fall 2016

Euler Angles Setting plane orientation rotY, rotZ; rotZ, rotY, or the same? Order of commands? Rotation.order ! http://jsfiddle.net/game3js/Lwe996ka/ Fall 2016

Axis Angle Good for axis-symmetric object (e.g., missile), specifying the direction vector Object3D.rotateOnAxis ( axis, angle ) axis: normalized vector in object space.  angle: in radians Example: New dir: (1,1,1).normalize() Usually, direction vectors are in world space (careful to set up the correct object hierarchy) http://jsfiddle.net/game3js/4q54yrgy/ This is better! Fall 2016

Rotation Matrix Given local x: dir (0,1,0) Given local x: dir Compute local Y by “Gram-Schmidt-ing” (0,1,0) with localX Cross to get localZ Specify orientation by setting the basis vectors dir Reference: https://threejs.org/docs/manual/introduction/Matrix-transformations.html Fall 2016

Matrix4 Three.js describes the configuration of an object using a 4x4 matrix When R & t are both given, it corresponds to “Rotate then Translate” Fall 2016

Matrix4 http://jsfiddle.net/game3js/oj41z87y/ Fall 2016

http://jsfiddle.net/game3js/sq5d7tv7/ Animation q x z Fall 2016

Interpolation: lerp & slerp SLERP: SphericaL intERPolation; LERP: Linear intERPolation Interpolation: lerp & slerp Quaternion: setFromEuler setFromRotationMatrix  setFromUnitVectors ( vFrom, vTo )  Sets this quaternion to the rotation required to rotate direction vector vFrom to direction vector vTo. [setFromAxisAngle] [Next step: keyframe interpolation] Fall 2016

q.setFromUnitVectors Missile: http://jsfiddle.net/game3js/xykp9ahL/ Fall 2016

q.setFromEuler http://jsfiddle.net/game3js/s4ncd03m/ Fall 2016

q.setFromRotationMatrix http://jsfiddle.net/game3js/73vw9c2a/ Fall 2016