1 / 35

Geometry: Coordinate Frames

CSC 341 Introduction to Computer Graphics. Geometry: Coordinate Frames. Objectives. Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for representing affine spaces Discuss change of frames and bases

halen
Télécharger la présentation

Geometry: Coordinate Frames

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 341 Introduction to Computer Graphics Geometry: Coordinate Frames

  2. Objectives • Introduce concepts such as dimension and basis • Introduce coordinate systems for representing vectors spaces and frames for representing affine spaces • Discuss change of frames and bases • Introduce homogeneous coordinates

  3. Vector representation • A vector can be represented by a column of scalars

  4. Scalar vector multiplication

  5. Vector vector addition

  6. Linear Independence • A set of vectors v1, v2, …, vn is linearly independent if a1v1+a2v2+.. anvn=0 iff a1=a2=…=0 • If a set of vectors is linearly independent, we cannot represent one in terms of the others • If a set of vectors is linearly dependent, as least one can be written in terms of the others

  7. Dimension and Basis • In a vector space, the maximum number of linearly independent vectors is fixed and is called the dimension of the space • In an n-dimensional space, any set of n linearly independent vectors form a basis for the space • Given a basis v1, v2,…., vn, any vector v can be written as v=a1v1+ a2v2+….+anvn where the {ai} are unique

  8. Example v are two linearly independent vectors in 2D

  9. Example v

  10. Consider 3-space (3D) • Standard Basis: composed of 3 unit vectors, usually referred by the corresponding coordinate vectors. • Unit length • Mutually orthogonal z x y

  11. Representation of vectors • Consider a basis v1, v2,…., vn • Any vector v is written v=a1v1+ a2v2+….+anvn • The list of scalars {a1, a2, …. an}is the representation ofvwith respect to the given basis • We can write the representation as a row or column array of scalars These are the cartesian coordinates of vector v [a1a2 …. an]T=

  12. Example • v=2v1+3v2-4v3 • [2 3 –4]T • Note that this representation is with respect to a particular basis

  13. Basis • Which is correct? • Both are because vectors have no fixed location v v

  14. Coordinate Frames • A set of basis vectors is insufficient to represent points • If we work in an affine space we can add a single point, the origin, to the basis vectors to form a coordinate frame • Hence, a coordinate frame for n-space consists of a point called origin and n linearly independent vectors. v2 v1 P0 v3

  15. ey ex P0=(0,0) Example: Standard Coordinate Frame in 2D P

  16. ex ey P0=(0,0) Example: Standard Coordinate Frame in 2D • Observe that P - P0 = b1ex+ b2ey is a vector P

  17. ex ey P0=(0,0) Example: Standard Coordinate Frame in 2D • Every point can be written as P = P0 + b1ex+ b2ey are the cartesian coordinates of point P P

  18. Representation in a Frame • In general, frame determined by (P0, v1, v2, v3 ,…,vn) • Within this frame, every vector can be written as v=a1v1+ a2v2+….+anvn • Every point can be written as P = P0 + b1v1+ b2v2+….+bnvn are the cartesian coordinates of point P [b1b2 …. bn]T=

  19. Confusing Points and Vectors Consider the point and the vector P = P0 + b1v1+ b2v2+….+bnvn v=a1v1+ a2v2+….+anvn They appear to have the similar representations p=[b1 b2 b3] v=[a1 a2 a3] which confuses the point with the vector A vector has no position v p v Vector can be placed anywhere point: fixed

  20. Represent P and w with respect to Frame F and Frame G w P G.e1 F.e1 G.O G.e0 F.e0 F.O

  21. Represent P and w with respect to Frame F and Frame G P G.e1 w F.e1 G.e0 F.e0

  22. W[F] • W[F] =

  23. Represent P and w with respect to Frame F and Frame G P P - F.O G.e1 F.e1 G.e0 F.e0

  24. P[F] • P[F] =

  25. A Single Representation If we define 0•P = 0 and 1•P =P then we can write w=2 F.e0 +1F.e1 + 0 •F.0 P=3 F.e0 +2F.e1 + 1 •F.0 Thus we obtain the homogeneous coordinate representation Homeogeneous coordinate is 0 for vectors, 1 for points • P[F] = W[F] =

  26. In 3D v=a1v1+ a2v2+a3v3 = [a1 a2a30][v1 v2 v3 P0] T P = P0 + b1v1+ b2v2+b3v3= [b1 b2b31][v1 v2 v3 P0] T Thus we obtain the four-dimensional homogeneous coordinate representation v = [a1 a2a30] T P = [b1 b2b31] T

  27. In general • In n-dimensional space, a vector or point is represented by a column of n+1 scalars

  28. Homogeneous Coordinates and Computer Graphics • Homogeneous coordinates are key to all computer graphics systems • All standard transformations (rotation, translation, scaling) can be implemented with matrix multiplications using 4 x 4 matrices • Hardware pipeline works with 4 dimensional representations • All point-vector operations behave accordingly

  29. Error checking by homogeneous coordinate • Consider • v = Q – P = • Valid operation • Try vector-vector addition, u + v • Homogeneous coordinate of result is 0: valid operation • Try scalar-vector multiplication • Homogeneous coordinate of result is 0: valid operation • Try point point addition • Homogeneous coordinate of result is 2: illegal operation P = [321]T Q = [511]T [2-10]T

  30. Standard Frame in 3D

  31. Matrices • n x m array of scalars • n rows • m columns

  32. Matrix operations • Scalar-matrix multiplication: multiply all elemnts of the matrix by the scalar • Matrix-matrix addition: add corresponding elements of the two matrices • C = A+B =[aij + bij ]

  33. Matrix matrix multiplication • C = A.B = [cij ] • A is m X p • B is p X n

  34. Matrix operations rules • a(bA) = (ab)A • abA = baA • A+B = B+A • A+(B+C) = (A+B) +C • A(BC) = (AB)C • AB = BA • AI = A • Where I is the identity matrix, 1’s on the diagonal, 0’s elsewhere • IB = B • (AB)T = BT AT • A.A-1 = I

  35. Change of Representations • Converting point/vector representation from one coordinate frame to the other?

More Related