1 00:00:00,250 --> 00:00:03,337 Once you start looking under the hood, you'll get some sense of the lay of the 2 00:00:03,337 --> 00:00:06,769 land with matrices and how they relate to transforms. Here's a map of the sort 3 00:00:06,769 --> 00:00:11,246 of things you'll find. The upper left area of the matrix is where rotations and 4 00:00:11,246 --> 00:00:15,963 scales show up. If a transform changes only this area of the matrix, it's called 5 00:00:15,963 --> 00:00:19,985 a linear transformation. I'm not going to spend time on the formal definition of 6 00:00:19,985 --> 00:00:24,214 this term. The additional course materials include resources for more on the 7 00:00:24,214 --> 00:00:28,010 underlying math. The definition is fairly basic stuff about how addition and 8 00:00:28,010 --> 00:00:31,894 multiplication are preserved. But doesn't have much effect on how we actually do 9 00:00:31,894 --> 00:00:36,060 computer graphics. The upper right is where the translations accumulate. These 10 00:00:36,060 --> 00:00:39,544 translation values will get effected by multiplication with other matrices of 11 00:00:39,544 --> 00:00:43,896 course. Translations only effect points since vectors have zero for their fourth 12 00:00:43,896 --> 00:00:49,008 coordinate. 3JS provides a function called decompose to extract the translation, 13 00:00:49,008 --> 00:00:53,871 rotation and scale factors from a matrix. The translation and scale factors come 14 00:00:53,871 --> 00:00:58,557 back as vectors, as you might expect. The rotation comes back as a quaternion. 15 00:00:58,557 --> 00:01:02,874 Something we'll talk about when we get to animation. The short version is that a 16 00:01:02,874 --> 00:01:07,122 quaternion is a compact way to store the axis and angle of rotation for a 17 00:01:07,122 --> 00:01:11,707 rotation matrix. One useful property quarternions have is that you can easily 18 00:01:11,707 --> 00:01:15,861 interpolate between them, which is useful for interpolating between two 19 00:01:15,861 --> 00:01:20,100 different orientation. Notice that the bottom row is always 0, 0, 0 1. The 20 00:01:20,100 --> 00:01:24,597 transforms we covered here are called affine transforms. Parallel lines stay 21 00:01:24,597 --> 00:01:29,703 parallel when an affine transform is applied. In modeling you'll essentially 22 00:01:29,703 --> 00:01:34,304 always use affine transforms. So we never change this last row. Since GPUs are 23 00:01:34,304 --> 00:01:39,104 tuned to use four by four matrices Most of us just use four by fours everywhere 24 00:01:39,104 --> 00:01:43,579 for simplicites sake. When we discuss perspective cameras, we'll set the values 25 00:01:43,579 --> 00:01:48,230 in this last row. We'll then be using a projective transform. With affine 26 00:01:48,230 --> 00:01:52,523 transforms, when a points coordinates are multipied by the matrix. The fourth 27 00:01:52,523 --> 00:01:56,452 coordinate starts out as one and ends up as one. This last row in a projection 28 00:01:56,452 --> 00:02:00,324 matrix modifies that fourth coordinate to be something other than one. What that 29 00:02:00,324 --> 00:02:03,623 means is something we'll leave til a later lesson.