class: center, middle # Creación de Videojuegos ### Vector Math Practice --- class: small You are given a triangle with vertices (4,3,1), (6,4,-1), (3,3,3), and normal vector (2/3, -2/3, 1/3). The camera is located at (7,1,3), and looking in direction (-2,-2,-1). Does the triangle face the camera? How far from the plane of the camera is each of the three vertices (hint: The direction vector points in the same direction as the normal of the camera plane) --- class: small The player is at (1,2,1) and looking in direction (2,1,2). If they can see anything in front of them (180 degrees field of view), can they see the enemy at (3,-1,-2)? How large does their field of view have to be *at least* to be able to see the enemy? --- class: small Given a triangle with vertices (3,1,2), (4,1,3), (-1,-2,4), calculate the Barycenter of this triangle. The vertices are assigned the colors (42,126,222), (124, 204, 54) and (252,252,252). What is the color of the Barycenter? Which colors do the middle points of the three edges have? --- class: small # Matrix Problem Generator * On the right side you can type any combination of two movements or rotations and a vector, and the demo will calculate the matrices, the composed matrix, and how it transforms the given vector * On the bottom left, you can generate problems for you to solve as practice for the exam * The "Show Solution" button will automatically populate the fields on the right side and calculate the matrices * The box will show a visualization of the transformation, played out in steps ---
--- class: small # References * [Applications of the Vector Dot Product, Math for Java Game Programmers](https://www.developer.com/java/other/article.php/3779331/Applications-of-the-Vector-Dot-Product-Math-for-Java-Game-Programmers.htm) * [Understanding the Dot Product](https://betterexplained.com/articles/vector-calculus-understanding-the-dot-product/) * [Dot Product 101](http://xdpixel.com/dot-product-101/)