Vector Coordinates

Vector Coordinates

3D Transformations Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 1/26/07 1 Geometry ■ Geometric entities, such as points in space, exist without numbers. ■ Coordinates are a naming scheme. ° The same point can be described by different coordinates. Triangle Raleigh- ° Both vectors and points expressed by Durham coordinates, but they are very different ■ Our plan (50, 160) 1. understand the “things” 2. THEN associate coordinates to them. Go 7 miles southwest 1/26/07 2 Scalar Field ■ Definition. A set S over which addition (+) and multiplication (.) are closed. ∀a,b ∈S a + b ∈S a⋅b ∈S ■ These operators commute, associate, and distribute ∀a,b, c ∈S a + b = b + a a⋅b = b ⋅a a + (b + c) = (a + b) + c a⋅(b ⋅c) = (a⋅b)⋅c a⋅(b + c) = a⋅b + a⋅c ■ Both operators have a unique identity element aa+ 01=⋅a=a ■ Each element has a unique inverse under both operators − aa+ ()−=0a⋅a1 =1 1/26/07 3 Example Scalar Fields ■ Real Numbers ■ Complex Numbers (given the standard definitions for addition and multiplication) ■ Rational Functions (Ratios of polynomials) ■ Notation: we will represent scalars by lower case letters. a, b, c, … are scalar variables. 1/26/07 4 Vector Spaces K ■ Vector space (V): scalars and vectors, denoted by x . ■ Two operations for vectors: G G K K ° vector-vector addition ∀uv, ∈+V u v∈V G K ° scalar-vector multiplication ∀uV∈∀, aS∈ au∈V ■ Vector-vector addition commutes and associates. KKKK KKK KK K uv+=v+uu+()v+w=(u+v)+w ■ There is also an additive identity, and an additive inverse for each vector K K KK K K uu+ 0(=+u−u)=0 ■ Scalar-vector multiplication distributes K K K K K K K (a + b)u = au + bu a(u + v) = au + av 1/26/07 5 Example Vector Spaces ■ Geometric Vectors (directed segments) K K u K K K v K v w u 2u G K K u + v = w K − v ■ N-tuples of scalars KKK K uu=+(1,3,7)ttv=(3,5, 4) =w K K vu=−(2,2, 3)tt2 =(2,6,14) KK wv=−(3,5, 4)tt=(−2,−2,3) ■ Not coincidentally, we can use N-tuples to represent vectors 1/26/07 6 Basis Vectors ■ A vector basis is a subset of vectors from V that can be used to generate any other element in V, using just additions and scalar multiplications. K K K ■ A basis set, v 1 , v 2 ,..., v n , is linearly dependent if: n K ∃a1, a2 ,..., an ≠ 0 such that ∑aiv i = 0 i=0 Otherwise, the basis set is linearly independent. A linearly independent basis set with i elements is said to span an i-dimensional vector space. Basis vectors are physical things, not numbers. 1/26/07 7 Vector Coordinates ■ A linearly independent basis set can be used to uniquely name or address a vector. This is the done by assigning the vector coordinates as follows: ⎡⎤c1 K 3 K KK K⎢⎥K ==⎡⎤=t xc∑ iiv⎣⎦v12vv3⎢⎥c2 vc i =1 ⎢⎥ ⎣⎦c3 ■ Note: we’ll use bold letters to indicate tuples of scalars that are interpreted as coordinates ■ Our vectors are still abstract entities. So how do we interpret the equation above? 1/26/07 8 Interpreting Vector Coordinates K c3v 3 K K v t c c3v 3 K v t c K K v 3 K c v c v 1 1 K 2 2 K v 2 c v K 2 2 v 1 K c1v 1 Valid Interpretation Equally Valid Interpretation Remember, vectors don’t have any notion of position 1/26/07 9 Linear Transforms A linear transformation, L, is just a mapping from V to V which satisfies the following properties: K K K K K K L(u + v) = L(u) + L(v) and L(au) = aL(u) Transforms my basis vectors and leaves the Linearity implies: coordinates K K ⎛ K ⎞ K unchanged x ⇒ L(x) = L⎜∑civ i ⎟ = ∑ciL(v i ) ⎝ i ⎠ i K Expressing x with a basis and coordinate vector gives: ⎡cc11⎤⎡⎤ KK K⎢ ⎥⎢K K K ⎥ ⎡⎤⇒ ⎡ ⎤ ⎣⎦vv12v3⎢c2⎥⎢⎣LL()v1 (v2) L(v3)⎦c2⎥ ⎢ ⎥⎢⎥ ⎣cc33⎦⎣⎦ 1/26/07 10 Matrices Linear transformations are equivalent to those that can be expressed using matrices and matrix operations. ⎡cm11⎤⎡1m12m13⎤⎡c1⎤ KK K⎢ ⎥⎢KKK ⎥⎢⎥ ⎡⎤⇒ ⎡⎤ ⎣⎦LL()vv12( ) L(v3)⎢c2⎥⎢⎣v1v2v3⎦m21m22m23⎥⎢c2⎥ ⎢ ⎥⎢⎥⎢⎥ ⎣cm33⎦⎣1m32m33⎦⎣c3⎦ We can interpret this expression in one of two ways ⎛⎞⎡⎤mm11 12 m13 ⎡c1 ⎤ ⎛⎞⎡mm11 12 m13 ⎤⎡c1 ⎤ ⎜⎟KK K⎢⎥⎢⎥KK K⎜⎟⎢ ⎥⎢ ⎥ ⎡⎤ ⎡⎤ ⎜⎣vv12v3⎦⎢⎥m21m22m23⎟⎢c2⎥⎣vv12v3⎦⎜⎢m21m22m23⎥⎢c2⎥⎟ ⎜⎟⎢⎥⎢⎥ ⎜⎟⎢ ⎥⎢ ⎥ ⎝⎠⎣⎦mm31 32 m33 ⎣c3 ⎦ ⎝⎠⎣mm31 32 m33 ⎦⎣c3 ⎦ change of basis vectors change of coordinates 1/26/07 11 Reading Matrix Expressions Often we desire to apply sequences of operations to vectors. For instance, we might want to rotate a particular vector, add it to some other vector, and then rotate the result back. In order to specify and interpret such sequences, you should become proficient at reading matrix expressions. Consider the following expression: KKt ttK KtK t K t K t K t vvcM⇒=c(vM)c=mcv c ⇒ v Mc = v (Mc) = v d Think of this as Think of this as moving changing from one space an vector, changing its to another (i.e. world coordinates, within a space to eye space) common space. (i.e. rotate a normal around some axis) 1/26/07 12 The Basis is Important! If you are given coordinates and told to transform them using a matrix, you have not been given enough information to determine the final mapping. Consider the matrix: ⎡2 0 0⎤ = ⎢ ⎥ M ⎢0 1 0⎥ ⎣⎢0 0 1 ⎦⎥ If we apply this matrix to coordinates there must be some implied basis, because coordinates are not geometric entities (a basis is required to K convert coordinates into a vector). Assume this implied basis is w t. Thus, K K our coordinates describe the vector v = w t c . The resulting transform, K K w t c ⇒ w tMc, will stretch this vector by a factor of 2 in the direction of the first elementK of the basis set. Of course that direction depends entirely on w t. 1/26/07 13 Transformation Example t w = [v1, v2, v3] t n = [v1, v2, v3] These vectors with identical initial and final coordinates are very different geometric entities 1/26/07 14 Points Conceptually, Points and Vectors are very different. A point is a place in space. A vector describes a direction independent of position. As mentioned previously, we will distinguish between points and vectors in our notation. K Points are denoted as p and vectors as v . Furthermore, we will consider vectors to live in the Linear space R3 and points to to live in the Affine space A3. Let’s clarify this distinction. 1/26/07 15 How Vectors and Points Differ The operations of addition and multiplication by a scalar are well defined for vectors. The addition of 2 vectors expresses the concatenation of 2 “motions”. Multiplying a vector by some factor scales the motion. However, these operations don’t make sense for points. What should it mean to add two points together? For example, what is Raleigh plus Durham? What does it mean to multiply a point by an arbitrary scalar? What is 7 times Chapel Hill? K 2 b K K a+b 1/26/07 16 Making Sense of Points There are some operations that do make sense for points. For instance, if you want to compute a vector that describes the motion from one point to another. K p − q = v We can also find a new point that is some vector away from a given point. K q + v = p 1/26/07 17 A Basis for Points One of the goals of our definitions is to make the subtle distinctions between points and vectors more apparent. The key distinction between vectors and points are that points are absolute whereas vectors are relative. We can capture this notion in our definition of a basis set for points. A vector space is completely defined by a set of basis vectors, however, the space that points live in requires the specification of an absolute origin. ⎡c1 ⎤ ⎢c ⎥ K K K K ⎢ 2 ⎥ p = o + ∑v ici = []v 1 v 2 v 3 o i ⎢c3 ⎥ ⎢ ⎥ ⎣ 1 ⎦ Notice how 4 scalars (one of which is 1) are required to identify a 3-D point. 1/26/07 18 Frames We distinguish between spaces that points live in and spaces that vectors live in by our basis definition. We will call the spaces that points live in Affine spaces, and explain why shortly. We will also call affine-basis-sets frames. t K K K f = [v 1 v 2 v 3 o] BTW, frames can describe vectors as well as points. ⎡c1 ⎤ ⎡c1 ⎤ ⎢ ⎥ ⎢ ⎥ KK K c2 K KK K c2 ⎢ ⎥ ⎢ ⎥ pv= ⎣⎦⎡⎤12vv3o xv= ⎣⎦⎡⎤12vv3o ⎢c3 ⎥ ⎢c3 ⎥ ⎢ ⎥ ⎢ ⎥ ⎣ 1 ⎦ ⎣ 0 ⎦ 1/26/07 19 Pictures of Frames Graphically, we will distinguish between vector bases and affine bases (frames) using the following convention. K v t Three vectors f t Three vectors and a point 1/26/07 20 A Consistent Model Note how the behavior of affine frame coordinates is completely consistent with our intuition. Subtracting two points yields a vector. Adding a vector to a point produces a point. If you multiply a vector by a scalar you still get a vector. And, in most cases, when you scale points you’ll get some nonsense 4th coordinate element, which should serve to remind you that the thing you’re left with is no longer a point.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    31 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us