This preview shows page 1. Sign up to view the full content.
Unformatted text preview: mation matrix that moves the scene
scene to that coordinate system, we need to ﬁnd it
to that coordinate system, we need to ﬁnd it !
I We are given a view direction d and location C
– We are given a view direction d and location C ! To see how to get the matrix, we introduce the idea of the dot product as a To see how to get the matrix, we introduce the idea of the dot
projection !
product as a projection
Graphics Lecture 2: Slide 35 ! 34 / 45 The dot product asas projection !
The dot product a projection
The dot product is deﬁned as
• The dot product is deﬁned as !P · u = Pu cos ✓
P · u = Pu cos θ
If u is
• If u is !
I a unit vector
– a unit vector then P · thenP c·os θ P cos ✓
u= P u=
I along a coordinate axis then P · u is the ordinate of P in the
– along a coordinate axis then P · u is the ordinate of P in the
directiondirection of u
of u Graphics Lecture 2: Slide 36 !
35 / 45 Changing axes projection
Changingaxes byby projection !
Extending the idea to three dimensions we see see that
• Extending the idea to three dimensions we can canthat a change
aof hange ofbe expressed asexpressed as projections using
c axes can axes can be projections using the dot product
the dot product !
For example, call the ﬁrst
coordinate of P in the new
For example, call the ﬁrst
t
system Px coordinate of P in the new
t
system Pxt ! (P C) · u
Px =
!
= P·u C·u
Pxt = (P−C)·u
= P·u−C·u Graphics Lecture 2: Slide 37 ! Transforming point P
Transforming P
Transforming point point P Given point P in the (x, y, z ) axis system, we can calculate the
corresponding point in(x, y,(z ) v, w)system, we can calculate the
the
Given pointpoint then the (u, y, z) asystem as: we can calculate
• Given P in P i
x, axis xis system,
corresponding point in the (u, v, w) system w) system as:
the corresponding point)inu = (u,· v, as: C · u
t
Px = (P C · the P u
!
Cu
Ptt = P C u = P u C ·· v
Pyx = ((P C))··v = P ··v Ptt = P
Pzy = ((P
t
Pz = ( P C v =P v
C))··w = P ·· w
C)...
View Full
Document
 Spring '14

Click to edit the document details