Actors, Cameras, Action ! Scenes, Actors, Cameras 3D Transformations

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Geometric Transformations
Three Dimensional Modeling Transformations
Chapter 2. Geometrical Methods - Quaternions -  전자공학 / Networked Virtual Computing Lab/ 조성업.
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.
CMPE 466 COMPUTER GRAPHICS
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
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Computer Graphics (Fall 2008) COMS 4160, Lecture 3: Transformations 1
Rotation representation and Interpolation
Computer Graphics (Fall 2004) COMS 4160, Lecture 3: Transformations 1
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.
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.
04 – Geometric Transformations Overview Geometric Primitives –Points, Lines, Planes 2D Geometric Transformations –Translation, Rotation, Scaling, Affine,
Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 3.1: 3D Geometry Jürgen Sturm Technische Universität München.
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.
Computer Graphics Bing-Yu Chen National Taiwan University.
Geometric Transforms Changing coordinate systems.
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.
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.
Advanced Computer Graphics Spring 2014
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Geometric Objects and Transformation
Animating Rotations and Using Quaternions. What We’ll Talk About Animating Translation Animating 2D Rotation Euler Angle representation 3D Angle problems.
Computer Graphics 3D Transformations. Translation.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Graphics CSCI 343, Fall 2015 Lecture 16 Viewing I
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
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:
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
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.
Fundamentals of Computer Animation Orientation and Rotation.
REFERENCE: QUATERNIONS/ Ogre Transformations.
3D Geometry and Transformations
Modeling Transformation
3D Rotation: more than just a hobby
Chapter 11 Three-Dimensional Geometric and Modeling Transformations
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 CC416 Week 15 3D Graphics.
3D Transformation.
Computer Graphics 3D Transformations
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Rotation representation and Interpolation
UMBC Graphics for Games
Geometric Objects and Transformations (II)
CSCE441: Computer Graphics 2D/3D Transformations
Transformations.
Presentation transcript:

Actors, Cameras, Action ! Scenes, Actors, Cameras 3D Transformations Viewing Setting up the Camera Viewing in OpenGL Hierarchical Modeling Implementing Hierarchies Building and Editing Hierarchies Expressions

Scenes, Actors, Cameras 영화찍기나 사진술(photography)과 유사. Our virtual world is called a scene. Scene안의 object들은 actors. 그걸 바라보는 시점과 시선방향 등 보는 것에 관련되는 parameter를 정하는 것 - Scene 안의 Camera 설정. Scene 안에 actor나 camera 를 놓고(positioning), 이동시키기 위해 3D transformation 사용.

The Scene Camera Screen Teapot Actor Chair Actor

사진술과의 유사성

Modeling, Viewing, Animation Scene 안에 object를 생성하고 배치하는 과정이 modeling 과정. 사진을 찍기 위해 실물영상을 처리하는 과정이 디지털 rendering 과정과 동일. 3D virtual scene으로부터 2D image 를 생성. Virtual Scene 안에 Camera를 set-up 하는 것 : viewing Actor와 camera를 움직이는 것 : animation

Modeling Object를 생성하고 3D scene 내에 놓는 것 포함. Object 를 scene에 배치하기 위해 3D Transformation 필요. 인간과 같은 복합적 object를 위한 hierarchical modeling 필요. 물체표현 방법을 추후 강의에서 다룰 것임.

3D Transformation 2D 에서와 유사. Homogeneous coordinate transformation 위해 4x4 matrices 이용 회전(Rotation)은 문제가 좀 더 복잡 왼손, 오른손 좌표계 회전에 영향 끼침. 하나의 회전에 관계되는 축이 하나 이상.

Translation / Scaling

Reflections on Coordinate Planes

3D Shears 3D shear matrix Example : Sx,y 는 x-component를 y를 따라 shearing.

Rotations About Coordinate Axis 좌표축에 대한 CCW 회전. 3D rotations do NOT commute !

Euler Angles Euler’s Theorem x,y,z 축 각각에 대한 각도 : Euler 각. yaw(head) 어떤 3D 회전이든 x,y,z축에 대한 세 rotation으로 얻어낼 수 있다. x,y,z 축 각각에 대한 각도 : Euler 각. roll(갸웃각), pitch(끄덕각), and yaw(도리각) yaw(head) roll pitch

Euler Angles 문제점 그럼에도 불구하고 많이 쓴다. 왜? 간단하니까. Matrix로부터 original angle값 추출 힘들다. (Moller책 p.39 참조) h(or yaw) = atan2(-f20, f22) p = arcsin(f21)   r = atan2(-f01, f11) Smooth interpolation 안됨. animation을 위해 angle을 interpolate할 때 이상한 motion 일어남. Transformation은 순서에 의존적인데, 어떤 order를 써야할지 알 수 없음. Gimbal Lock problem 발생. 그럼에도 불구하고 많이 쓴다. 왜? 간단하니까.

Gimbal Lock Problem y y y pitch(x축) yaw(y축) x x x z z z Euler 표현의 경우, global 축을 중심으로 회전하다 보면 한 축이 다른 축과 겹치게 되고, 원하는 방향으로의 회전을 만들어내기 어렵게 될 수 있다. This is gimbal lock. y y y pitch(x축) yaw(y축) 실제로는 roll됨. -90도 x x x z z z

Rotation About Arbitrary Axis 회전축을 나타내는 unit vector r과 그 축 중심의 회전각 (0 ~ 360) 으로 표현. x, y, z (unit vector representing arbitrary axis angles ) angle (angle to rotate around above axis ) r (eg. glRotated(angle,ur,us,ut) ) s t

Rotation About Arbitrary Axis Initial Position P1을 원점으로 XZ평면에 놓이도록 만큼 회전 Z축과 일치되게

An Aside : Quaternions Quaternion - 회전을 4개의 number로 표현 삼각함수 안 쓴다. (sin, cos --- no ! ) 기본 idea : 3개의 number가 축 v 를 표현. 각도를 explicitly 나타내지 않고, v의 magnitude로 sin 를 encode, 4번째 숫자가 cos 를 encode. Quaternion을 서로 곱할 수 있고, matrix 연산없이 직접 회전결과를 구하거나, 대응되는 회전 matrix를 구할 수 있다.

3D rotation problem Chap.3 Transforms Quaternion [정의] where

Quaternion Operation 두 quaternion의 곱셈 3D rotation problem Chap.3 Transforms Quaternion Operation 두 quaternion의 곱셈 참고 (p.43 유도과정)

Quaternion unit quaternion normalized quaternion 을 만족하는 것. 3D rotation problem Chap.3 Transforms Quaternion unit quaternion 을 만족하는 것. normalized quaternion q = q / sqrt( ) 이것이 방향을 나타내는 데 쓰임. http://www.cs.berkeley.edu/~laura/cs184/quat/quatproof.html

Quaternion http://www.flipcode.com/documents/matrfaq.html#Q47 Q48. How do quaternions relate to 3D animation? ----------------------------------------------- As mentioned before, Euler angles have the disadvantage of being susceptible to "Gimbal lock" where attempts to rotate an object fail to appear as expected, due to the order in which the rotations are performed. Quaternions are a solution to this problem. Instead of rotating an object through a series of successive rotations, quaternions allow the programmer to rotate an object through an arbitary rotation axis and angle. The rotation is still performed using matrix mathematics. However, instead of multiplying matrices together, quaternions representing the axii of rotation are multiplied together. The final resulting quaternion is then converted to the desired rotation matrix. Because the rotation axis is specifed as a unit direction vector, it may also be calculated through vector mathematics or from spherical coordinates ie (longitude/latitude). Quaternions offer another advantage in that they be interpolated. This allows for smooth and predictable rotation effects.

Conversion to Quaternions 3D rotation problem Chap.3 Transforms Conversion to Quaternions Axis angle to Quaternion If the axis of rotation is (ax, ay, az)- must be a unit vector and the angle is theta (radians) then w = cos(theta/2) x = ax * sin(theta/2) y = ay * sin(theta/2) z = az * sin(theta/2) 회전시키고자 하는 점(vector) theta만큼의 회전을 계산

Conversion to Quaternions 3D rotation problem Chap.3 Transforms Conversion to Quaternions Euler to Quaternion if you have three Euler angles (a, b, c), Qx = [ cos(a/2), (sin(a/2), 0, 0)] Qy = [ cos(b/2), (0, sin(b/2), 0)] Qz = [ cos(c/2), (0, 0, sin(c/2))] then the final quaternion : Qx * Qy * Qz [생략]

Conversion from Quaternion 3D rotation problem Chap.3 Transforms Conversion from Quaternion Quaternion to Matrix Matrix = [ w2 + x2 - y2 - z2 2xy - 2wz 2xz + 2wy 2xy + 2wz w2 - x2 + y2 - z2 2yz - 2wx 2xz - 2wy 2yz + 2wx w2 - x2 - y2 + z2 ] [ 1 - 2y2 - 2z2 2xy - 2wz 2xz + 2wy 2xy + 2wz 1 - 2x2 - 2z2 2yz - 2wx 2xz - 2wy 2yz + 2wx 1 - 2x2 - 2y2 ] 삼각함수 계산 필요 없으므로, efficient.

Quaternion to Axis Angle 3D rotation problem Chap.3 Transforms Quaternion to Axis Angle Quaternion to Axis-Angle If the axis of rotation is (ax, ay, az) and the angle is theta (radians) then the angle= 2 * acos(w) ax= x / scale ay= y / scale az= z / scale where scale = x2 + y2 + z2 [생략]