Elements of Computer Graphics

Similar documents
SUMMARY. CS380: Introduction to Computer Graphics Quaternions Chapter 7. Min H. Kim KAIST School of Computing 18/04/06.

2.1: What is physics? Ch02: Motion along a straight line. 2.2: Motion. 2.3: Position, Displacement, Distance

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Let us start with a two dimensional case. We consider a vector ( x,

CSE-4303/CSE-5365 Computer Graphics Fall 1996 Take home Test

Phys 221 Fall Chapter 2. Motion in One Dimension. 2014, 2005 A. Dzyubenko Brooks/Cole

Basilio Bona ROBOTICA 03CFIOR 1

CSE 5365 Computer Graphics. Take Home Test #1

Kinematics Vocabulary. Kinematics and One Dimensional Motion. Position. Coordinate System in One Dimension. Kinema means movement 8.

3D Coordinate Systems. 3D Geometric Transformation Chapt. 5 in FVD, Chapt. 11 in Hearn & Baker. Right-handed coordinate system:

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

From Particles to Rigid Bodies

Kinematics and kinematic functions

Solutions from Chapter 9.1 and 9.2

HW6: MRI Imaging Pulse Sequences (7 Problems for 100 pts)

Concourse Math Spring 2012 Worked Examples: Matrix Methods for Solving Systems of 1st Order Linear Differential Equations

Linear Algebra Primer

Lab #2: Kinematics in 1-Dimension

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

Equations of motion for constant acceleration

y z P 3 P T P1 P 2. Werner Purgathofer. b a

The Paradox of Twins Described in a Three-dimensional Space-time Frame

Math 315: Linear Algebra Solutions to Assignment 6

This is an example to show you how SMath can calculate the movement of kinematic mechanisms.

Content-Based Shape Retrieval Using Different Shape Descriptors: A Comparative Study Dengsheng Zhang and Guojun Lu

Linear Response Theory: The connection between QFT and experiments

Constant Acceleration

Lie Derivatives operator vector field flow push back Lie derivative of

Non-uniform circular motion *

Math From Scratch Lesson 34: Isolating Variables

KINEMATICS IN ONE DIMENSION

Linear Algebra Primer

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

We just finished the Erdős-Stone Theorem, and ex(n, F ) (1 1/(χ(F ) 1)) ( n

Kinematics and kinematic functions

Welcome Back to Physics 215!

Ground Rules. PC1221 Fundamentals of Physics I. Kinematics. Position. Lectures 3 and 4 Motion in One Dimension. A/Prof Tay Seng Chuan

CoE4TN3 Image Processing

4. Electric field lines with respect to equipotential surfaces are

Applications of the Basic Equations Chapter 3. Paul A. Ullrich

Two Coupled Oscillators / Normal Modes

Kinematics in One Dimension

Week 1 Lecture 2 Problems 2, 5. What if something oscillates with no obvious spring? What is ω? (problem set problem)

Echocardiography Project and Finite Fourier Series

Velocity is a relative quantity

Math 334 Fall 2011 Homework 11 Solutions

k 1 k 2 x (1) x 2 = k 1 x 1 = k 2 k 1 +k 2 x (2) x k series x (3) k 2 x 2 = k 1 k 2 = k 1+k 2 = 1 k k 2 k series

Q.1 Define work and its unit?

Distance Between Two Ellipses in 3D

Homework sheet Exercises done during the lecture of March 12, 2014

Twin Paradox Revisited

Roller-Coaster Coordinate System

Physics for Scientists and Engineers I

Object tracking: Using HMMs to estimate the geographical location of fish

15. Vector Valued Functions

Math 221: Mathematical Notation

The Influence of Gravitation on the Speed of Light and an Explanation of the Pioneer 10 & 11 Acceleration Anomaly

IB Physics Kinematics Worksheet

Physics 5A Review 1. Eric Reichwein Department of Physics University of California, Santa Cruz. October 31, 2012

Principle of Least Action

In this chapter the model of free motion under gravity is extended to objects projected at an angle. When you have completed it, you should

SPH3U: Projectiles. Recorder: Manager: Speaker:

A Special Hour with Relativity

Physics for Scientists & Engineers 2

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

2001 November 15 Exam III Physics 191

1. Kinematics I: Position and Velocity

Name: Total Points: Multiple choice questions [120 points]

Physics 240: Worksheet 16 Name

AP Physics 1 - Summer Assignment

Oscillations. Periodic Motion. Sinusoidal Motion. PHY oscillations - J. Hedberg

Physics 20 Lesson 5 Graphical Analysis Acceleration

Effects of Coordinate Curvature on Integration

Linear Algebra Primer

15. Bicycle Wheel. Graph of height y (cm) above the axle against time t (s) over a 6-second interval. 15 bike wheel

Model Reduction for Dynamical Systems Lecture 6

10. State Space Methods

Exponential and Logarithmic Functions -- ANSWERS -- Logarithms Practice Diploma ANSWERS 1

SEIF, EnKF, EKF SLAM. Pieter Abbeel UC Berkeley EECS

Math Week 14 April 16-20: sections first order systems of linear differential equations; 7.4 mass-spring systems.

Integration Over Manifolds with Variable Coordinate Density

4.5 Constant Acceleration

Homework 2: Kinematics and Dynamics of Particles Due Friday Feb 8, 2019

NEWTON S SECOND LAW OF MOTION

On Measuring Pro-Poor Growth. 1. On Various Ways of Measuring Pro-Poor Growth: A Short Review of the Literature

EXPLICIT TIME INTEGRATORS FOR NONLINEAR DYNAMICS DERIVED FROM THE MIDPOINT RULE

PHYSICS 149: Lecture 9

3, so θ = arccos

Kinematics. See if you can define distance. We think you ll run into the same problem.

Speaker Adaptation Techniques For Continuous Speech Using Medium and Small Adaptation Data Sets. Constantinos Boulis

Review Equations. Announcements 9/8/09. Table Tennis

Chapters 6 & 7: Trigonometric Functions of Angles and Real Numbers. Divide both Sides by 180

AP Physics 1 - Summer Assignment

and v y . The changes occur, respectively, because of the acceleration components a x and a y

THE 2-BODY PROBLEM. FIGURE 1. A pair of ellipses sharing a common focus. (c,b) c+a ROBERT J. VANDERBEI

Chapter 7: Solving Trig Equations

x i v x t a dx dt t x

2.3 SCHRÖDINGER AND HEISENBERG REPRESENTATIONS

SMT 2014 Calculus Test Solutions February 15, 2014 = 3 5 = 15.

Transcription:

CS580: Compuer Graphics Min H. Kim KAIST School of Compuing Elemens of Compuer Graphics Geomery Maerial model Ligh Rendering Virual phoography 2

Foundaions of Compuer Graphics A PINHOLE CAMERA IN 3D 3 Pinhole camera model z e = Only rays of ligh ha pass hrough his poin reach he film plane and have heir inensiy recorded on film. The image is recorded a a film plane placed a, say, z e = 4 2

Geomeric daa ypes Poin: p represens place Vecor: v represens moion/offse beween poins Coordinae vecor: c! Coordinae sysem: s basis for vecors frame for poins 5 Vecor space A vecor space V is some se of elemens v Coordinae vecor: c if...bn are linearly independen, all vecors v of V can be expressed wih coordinaes c i of a basis of V (a se of b i ). n is he dimension of he basis/space v c = c i b i = b v = b c. 3 c 2. i c 3 6 3

Linear ransformaion 3-by-3 marix Linear ransform of a vecor Linear ransform of a basis v! = b "! c b!" Mc M, M,2 M,3 M 2, M 2,2 M 2,3 M 3, M 3,2 M 3,3. v = b c = a M c. 7 Lef-of rule Poin is ransformed wih respec o he he frame ha appears immediaely o he lef of he ransformaion marix in he expression. We read f f S f is ransformed by We read f S wih respec o f = a A a SA S a f is ransformed by wih respec o 8 4

Scaling a poin over frame p = f c f Sc p is ransformed by S wih respec o f 9 Scaling a poin over frame p = a A c a SA c is ransformed by S wih respec o p a 0 5

Scaling a poin over frame Roaing a poin over frame The same reasoning o ransformaions of frames hemselves: f f R f is ransformed by wih respec o f In anoher frame: f R f = a A a RA is ransformed by R wih respec o a 2 6

Roaing a poin over frame p is ransformed by wih respec o f R p = f c f Rc 3 Roaing a poin over frame p = a A c a RA c is ransformed by R wih respec o p a 4 7

Roaing a poin over frame 5 Auxiliary Frame You wan o build he solar sysem The Moon roaes around he Earh s frame The Earh roaes around he Sun s frame The Moon The Earh The Sun 6 8

Produc of vecors & roaion Do produc: Cross produc: v w := v w cosθ. v w := v w sinθn, 3D roaion marices: around z axis, x axis, y axis cosθ sinθ 0 sinθ cosθ 0 0 0 0 0 0 cosθ sinθ 0 sinθ cosθ cosθ 0 sinθ 0 0 sinθ 0 cosθ 7 Roaion ransformaion 3-by-3 ransform marix!"!" a b c e f g i j k. 8 9

Translaion ransformaion 3-by- ranslaion!"!" + d + h + l. 9 Roaion+Trans. ransformaion 3-by-4 ransform marix (non-square marix, no-inverible)!"!" a b c e f g i j k d h l. 20 0

Linear ransformaion 3-by-3 ransform marix à 4-by-4 affine ransform o o a b c 0 e f g 0 i j k 0 0 0 0. 2 Translaion ransformaion ranslaion ransformaion o poins b o o 0 0 x 0 0 y 0 0 z 0 0 0. 22

Affine ransform marix An affine marix can be facored ino a linear par and a ranslaional par: a b c d e f g h i j k l 0 0 0 = 0 0 d 0 0 h 0 0 l 0 0 0 a b c 0 e f g 0 i j k 0 0 0 0. l 0 = i 0 l 0 0 A = TL 23 Normals Normal: a vecor ha is orhogonal o he angen plane of he surfaces a ha poin. he angen plane is a plane of vecors ha are defined by subracing (infiniesimally) nearby surface poins: n ( p p 2 ) = 0 24 2

The eye s view (a virual camera) The world frame is in red The objec frame is in green The eye frame is in blue The eye is looking down is negaive z oward he objec. 25 World, objec and eye frames World frame (world coordinaes) a basic righ-handed orhonormal frame we never aler his frame w oher frames can be described wr he world frame Objec frame (objec coordinaes) model he geomery of he objec using verex coordinaes no need o be aware of he global placemen a righ-handed orhonormal frame of objec Eye frame (camera coordinaes): laer on o 26 3

World vs. objec frame The relaionship beween he world frame and objec frame: affine 4-by-4 marix O (rigid body ransformaion: roaion + ranslaion only) o = w O The meaning of O is he relaionship beween he world frame o he objec s coordinae sysem. To move he objec frame o iself, we change he marix O. 27 The eye frame Eye frame (camera coordinaes) a righ-handed orhonormal frame e he eye looks down is negaive z axis o make a picure e = w E 28 4

Exrinsic ransformaion of he eye we explicily sore he marix p = o c = w Oc = e E Oc Objec coordinaes: c World coordinaes: Oc Eye coordinaes: E Oc Calculaing he eye coordinaes of every verexes: x e y e z e E = E O e = w E x o y o z o 29 Moving an Objec We wan he objec o roae around is own cener abou he viewer s y axis, when we move he mouse o he righ. How we could do his? 30 5

Moving an Objec Basic idea: se a frame o = w O = a A O a MA O a = w A = w AMA O. Wha is he bes frame a o do his? 3 Moving an Objec Wha if we choose o we ransform his objec wih respec o o raher han wih respec o our observaion hrough he window. 32 6

Moving an Objec Wha if we choose o we ransform his objec wih respec o o raher han wih respec o our observaion hrough he window. Wha if we ransform wih respec o o e we will roae around he origin of he eye s frame e (i appears o orbi around he eye). Then wha frame i should be? 33 Moving an Objec We acually wan wo differen operaions. o ransform (roae) he objec a is origin 2. bu he roaion axis should be he y axis of he eye. 34 7

Moving an Objec From he lef, we ranslae he world frame o he cener of he objec s frame, and hen roaing he objec s frame abou ha poin o align wih he direcions of he eye. 35 How o move an Objec Recalling he Affine ransform.: A = TR The objec s Affine ransform.: O = (O) T (O) R (we wan he objec s roaion abou he objec s origin) The eye s Affine ransform.: E = (E) T (E) R (we wan he objec s roaion abou he eye s y axis)! The desired auxiliary frame a (imagine in a inverse way): a = w (O) T (E) R A = (O) T (E) R 36 8

Moving he eye We use he same auxiliary coordinae sysem. Bu in his case, he eye would orbi around he cener of he objec. Apply an affine ransform direcly o he eye s own frame (urning one s head, firs-person moion) e = w E, E EM 37 The eye marix (camera ransform) Specifying he eye marix e = w E by: he eye poin p he view poin (where he eye looks a) q he up vecor u z = normalize(p q) x = normalize(u z) y = z x normalize(c) = c / 2 + 2 + 2 NB marix sen o he verex shader is E - O E = x y z p x 2 y 2 z 2 p 2 x 3 y 3 z 3 p 3 0 0 0 z y u p x 38 9

The view marix (glulooka) Specifying he view marix V = E he eye poin p he view poin (where he eye looks a) he up vecor u z = normalize(q p) x = normalize(u z) y = x z normalize(c) = c / 2 + 2 + 2 V = NB glulooka is no he par of modern OpenGL! q x y z p x 2 y 2 z 2 p 2 x 3 y 3 z 3 p 3 0 0 0 x e y e z e = E O x z u p y 39 x o y o z o Modelview marix Modelview marix (MVM) E O Describes he orienaion and posiion of he view and he orienaion and posiion of he objec O wih respec o he eye frame p = o c = w Oc = e e E Oc The verex shader will ake hese verex daa and perform he muliplicaion E Oc, producing he eye coordinaes used in rendering normalmarix() produces he inverse ranspose of he linear facor o ge uniform NMVM E 40 20