1 / 23

SE 313 – Computer Graphics

SE 313 – Computer Graphics. Lecture 3: Analytical Geometry and Linear Algebra Lecturer: Gazihan Alankuş. Please look at the last three slides for assignments (marked with TODO ). Quiz. Turn off monitors Take out a piece of paper and a pen/pencil 5 minutes. Our Goal.

zareh
Télécharger la présentation

SE 313 – Computer Graphics

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. SE 313 – Computer Graphics Lecture 3: Analytical Geometry and Linear Algebra Lecturer: GazihanAlankuş Please look at the last three slides for assignments (marked with TODO)

  2. Quiz • Turn off monitors • Take out a piece of paper and a pen/pencil • 5 minutes

  3. Our Goal • Remember basic concepts in analytical geometry and learn about how they are applied in linear algebra and in computer graphics

  4. Coordinate Frame • An origin point • Three axes (x, y, z) • that are perpendicular to each other • that are ordered by the right hand rule (x-thumb, y-index finger, z-middle finger)

  5. Point • Location in space • Coordinates (x, y, z)

  6. Displacement between two points • Vector = Point – Point • Example: “North-east, 5 meters” • No position, only direction. • If you want to, you can draw it starting from any position.

  7. Representing points and vectors • Both of them are represented with three scalar values for the x, y and z axes. • They mean different things • Point – precise location in space • Vector – precise direction, no location

  8. Operations • Point addition • Point subtraction • Vector addition • Vector subtraction

  9. Operations • Point addition • Point subtraction -> Vector • Vector addition -> Vector • Vector subtraction -> Vector • Details are presented on the board, check your book or assigned online readings if you missed it.

  10. Different Coordinate Frames • In computer graphics sometimes we use multiple reference coordinate frames • World coordinates, character coordinates, camera coordinates, etc. • The same geometrical point or vector is represented with different values in different coordinate frames. • The values depend on the coordinate frame being used.

  11. More Simple Operations • Point – vector addition • Point scaling • Vector scaling

  12. More Simple Operations • Point – vector addition -> point • Point scaling -> point • Vector scaling -> vector • Details are presented on the board, check your book or assigned online readings if you missed it.

  13. Vectors have length • How much you would travel if you followed the vector • Unit vectors: a vector in the same direction, but with a length of 1 • Direction without magnitude

  14. More Interesting Operations • Vector dot product • Vector cross product

  15. More Interesting Operations • Vector dot product -> scalar • Vector cross product -> vector

  16. Dot product • Gives a number for two vectors • Greatest when vectors are in the same direction • Zero when vectors are perpendicular • Negative when vectors are opposing • http://www.falstad.com/dotproduct/

  17. Properties • Dot product two perpendicular vectors, you get zero • Dot product a vector with itself, you get the square of its magnitude • Can be used to calculate projections

  18. Cross product • Gives a new vector for two vectors • (don’t try to memorize, use computers) • Perpendicular to the two vectors according to the right hand rule • Maximum when vectors are perpendicular • Zero when vectors are the same or opposite directions • http://physics.syr.edu/courses/java-suite/crosspro.html

  19. Properties • (opposite direction)

  20. Angle between two vectors • Can find the angle using atan(y/x) • Watch out for the sign • Use atan2(y, x)

  21. Lab assignment • Part 1 • Open up Blender, create a cone. Go to edit mode. Make sure everything is selected using Select->(De)select All. • Use View->Properties to show the properties pane. You will see the median location of all selected points there. Set it to 0, 0, -2 so that the tip of the cone is at the reference point. • Go back to object mode. Make the cone red. Duplicate the cone, make that duplicate blue. You should have one red and one blue cone. • Create a sphere in origin and make it white. • Part 2 • Locate the two cones so that the vectors from the origin to the cones make an angle between 0-90 degrees. • Create two cylinders, locate and rotate them so that they look like the stems of the vectors. Color them the same as the cones. • Rotate the cones accordingly. The end result should look like two vectors with an angle between 0-90 degrees. • Part 3 • Convert the properties pane on the right to be a Python console. Create two vectors using a code like this. The values should come from the locations of the cones. • v1 = Vector([1.2, 1.3, -1.4]) • v2 = Vector([5.5, 1.4, -3.4]) • Calculate the cross product like this: • c=v1.cross(v2) • Normalize the vector using: • c.normalize() • print(c) • Draw a third vector starting from the origin and representing the normalized cross product. Make it green.

  22. TODO: Homework 3.a (video) • Re-watch the Blender intro to modeling video here: • http://cgcookie.com/blender/2010/08/31/blender-intro-to-modeling/ • There will be quiz about it next week.

  23. TODO: Homework 3.b (deliverable) • Start with a cube and use the extrude tool to create the first letter of your name. Feel free to make it pretty. • Submit the rendered image and the .blend file, just like you did last week.

More Related