1 / 31

CS361

Week 3 - Friday. CS361. Last time. What did we talk about last time? Vertex shaders Geometry shaders Pixel shaders. Questions?. Project 1. Using BasicEffect in XNA. Student Lecture: Vectors. Yeah… just what do you know about vectors?. Vectors. Euclidean space.

avi
Download Presentation

CS361

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. Week 3 - Friday CS361

  2. Last time • What did we talk about last time? • Vertex shaders • Geometry shaders • Pixel shaders

  3. Questions?

  4. Project 1

  5. Using BasicEffect in XNA

  6. Student Lecture: Vectors Yeah… just what do you know about vectors?

  7. Vectors

  8. Euclidean space • We refer to n-dimensional real Euclidean space as Rn • A vector v in this space is an n-tuple, an ordered list of n real numbers • To match the book (and because we are computer scientists), we'll index these from 0 to n – 1 • We will generally write our vectors as column vectors rather than row vectors

  9. Operations • We will be interested in a number of operations on vectors, including: • Addition • Scalar multiplication • Dot product • Norm

  10. Addition • Addition of two vectors is just element-by-element addition

  11. Associativity and commutativity • Vector addition is associative: • Vector addition is commutative:

  12. Identity and inverse • There is a unique vector for Rn which is 0 = (0,0,…,0) with a total of n zeroes • o is additive identity: • For vector v, there is a unique inverse –v = (-v0, -v1, … -vn-1) • -v is the additive inverse:

  13. Scalar multiplication • Multiplication by a scalar is just element-by-element multiplication of that scalar

  14. Scalar rules • Rules for scalar multiplication can easily be inferred from the normal properties of reals under addition and multiplication:

  15. Dot product • The dot product is a form of multiplication between two vectors that produces a scalar

  16. Dot product rules • Dot product rules are slightly less obvious than scalar product

  17. Norm! • A norm is a way of measuring the magnitude of a vector • We are actually only interested in the L2 norm, but there are many (infinite) norms for any given vector space • We'll denote the norm of u as ||u||

  18. Rules for the norm

  19. Geometric Interpretation

  20. Geometry • Mathematical rules are one thing • Understanding how they are interpreted in geometry is something else • Unfortunately, this means getting more math to link up the existing math with geometry

  21. Linear independence • A set of vectors u0, u1, … un-1 is linearly independent if the only scalars that satisfy the following identity are v0 = v1 = … = vn-1 = 0 • In other words, you can't make any one vector out of any of the others

  22. Spanning and basis • A set of vectors u0, u1, … un-1spansRn if any vector vRn can be written: • In addition, if v0, v1, … , vn-1 are uniquely determined for all v Rn, then u0, u1, … un-1 form a basis of Rn

  23. Describing geometry • To properly describe Rn, the vectors we give are actually scalar multiplied by each of the basis vectors ui • By convention, we leave off the basis vectors ui, because it would be cumbersome to show them • Also, they are often boring: (1,0,0), (0,1,0), and (0,0,1)

  24. Interpretations • A vector can either be a point in space or an arrow (direction and distance) • The norm of a vector is its distance from the origin (or the length of the arrow) • In R2 and R3, the dot product is: where  is the smallest angle between u and v

  25. Bases • A basis is orthogonal if every vector in the basis is orthogonal to every other (has dot product 0) • An orthogonal basis is orthonormal if every vector in it has length 1 • The standard basis is orthonormal and made up of vectors ei which are all 0's except a 1 at location i

  26. Projections • We can find the orthogonal projection w of vector u onto vector v • Essentially, this means the part of u that's in v

  27. Cross product • The cross product of two vectors finds a vector that is orthogonal to both • For 3D vectors u and v in an orthonormal basis, the cross product w is:

  28. Cross product rules • In addition • wu and wv • u, v,and w form a right-handed system

  29. Upcoming

  30. Next time… • More linear algebra • Matrices • Homogeneous notation • Geometric techniques

  31. Reminders • Keep reading Appendix A • Assignment 1 due tonight by midnight! • Keep working on Project 1, due next Friday, February 8 by 11:59

More Related