 So, I would like to go into this I transformation next, if there are no questions about this ok. Remember all of this is being applied to these points. So, if I have a you know x y z 1 here right x y z is the point that I want to apply that is like a point on this cube that I drew the yellow cube that was drawn in the in the previous ah figure that I made on the board. I just put the point here add a 1 to it apply all of these transformations and then I will figure out in some kind of pixel coordinates that look like floating point numbers or real numbers depending on whether you are using a computer or not. It will it will give you these these coordinates that are not necessarily integers alright. So, I want to figure out the I transformation to make it really clear I will call it cyclopean cyclopean I transformation. So, if you are trying to imagine maybe people do not make a a distinction in computer graphics about this, but if you are doing virtual reality then you could build a virtual reality headset for a cyclops and then this would be just fine right, but because you have two eyes I do not want to pick the right or the left I would rather pick the midpoint between them to make everything simple here and then talk about how to do a nice offset for left and right. So, that is why we will imagine that we are designing a virtual reality headset for a cyclops ah in the beginning here alright. So, the first thing to do is to imagine that let us see to express the eyes rotation and translation in the world. So, in other words I just imagine that this eye it is like an eye ball with a with a pupil is is defined in some kind of body frame. Let me give you what is essentially the body frame of the eye I want to put the pupil right at the origin because that is the point where the light comes in in the real world. So, that is this is all virtual that I am drawing here, but nevertheless um why I have Z running into the eye and the only reason why we are doing that is so that we can maintain right handed coordinate system. So, it is another one of these annoyances that it is here for a good reason because if you do not do it this way then you will have more annoyances. So, it is a it is a it is a trade off um and member X is out. So, this is essentially a body frame for the eye ball and now if I take the eye ball and place it into the world there is going to be a transformation for that that is going to be a rotation and a translation of the eye ball. I want to figure out what that transformation is based on how I place the eye ball and then I want to use that to make the eye transform. So, one way to do that which is very common is to consider what is called a look at look at somewhat strange name, but a look at. So, here is how this works we have three things we have a position of the eye sometimes I will say position sometimes I will say translation sometimes I will say orientation sometimes I will say rotation. So, rotation and translation are the operations and then the result is orientation and position correct. So, so it is it is ok to interchange those as long as you understand what is going on. So, two I want to have a looking direction looking direction and three I need to specify an up direction. So, let me give some notation to these and I will explain it. So, the position of the eye I will just use as a vector E. So, I will just write it as E like this single letter and then the looking direction will be C little hard to write here I will put a hat on it to denote that we have unit vectors and you put a hat on to note it is a unit vector. If you do not like my hats leave them off, but they are unit vectors. So, I am trying to denote it somehow. So, how can I obtain the look at here is one possible way to do it. So, I have the eye and I have determined that the I decided that the pupil is going to be located at some location E. So, it is very easy to write down. So, imagine you are given where the eye is it will have some coordinates that correspond to where the pupil is at I will call that E and then if you are told that let us see if you are told that the pupil is looking at a particular point see here get rid of that. So, the eye is pointed towards a particular point here call it L then you get a vector let us say a vector that corresponds to travelling from the pupil to the point L. So, I can just call this vector C I will say that C is just using the simple coordinates that you have here the Cartesian coordinates of the world L minus E right. So, that gives me that vector right. So, it gives me that vector and then my C hat which is the looking direction here number 2 and given you number 1 by just simple specification number 2 I just normalize that vector. So, L minus E divided by the length of that vector L minus E correct. So, that is I am what am I doing I am trying to specify the coordinate frame that I get here right how is it oriented in the world when the eye is looking at a particular place. So, I just want to describe that I want to figure out that coordinate frame and then from that very easily construct a rotation matrix that will put the eye in that orientation and of course, construct a full homogeneous transformation matrix that will also put it in the right location, but that part is considerably easier because it is just translation by E. So, I need to figure out the orientation of this eye I am trying to put together the coordinate system it looks like once I figured out C hat I should essentially have the Z part right it is just pointing in the wrong direction. So, it will be the C hat corresponds to the minus E and then there is also a possible role with respect to that that has to do with the up direction which we will have to take care of. And once we have the up direction and we have let us say the forward backwards direction we can do a simple cross product right handed cross product to determine the third axis the third direction and we agreed to do right handed coordinates and so that will matter. So, if that is the case then if I want to figure out these axes. So, the the let us say coordinate axes for the eye in the world then I get X hat Y hat Z hat for these and as I said Z hat is going to be minus C hat. So, I am figuring out that one if I have this eyeball oriented somewhere I am figuring out that part and then X hat X hat I take the up direction and I cross it with Z hat right. So, I take my up direction I cross it with Z hat and I guess Y should be should Y just be U hat that make natural sense. So, when I started teaching this I thought Y should be U hat and then I noticed it was not in the in the in the in the text book for example, by Shirley that we are using and it is not in a lot of the graphics literature and it is instead just Z cross X right Z hat cross X hat which is also fine the reason why they do not use U here directly is just in case someone gave you a U that was not perfectly parallel to the image plane right. So, it does not correspond perfectly it is not. So, if I look if I am if the I is actually my I then if you instead of pointing straight up is slanted some this would correct for that if you do it in this way. So, it will tolerate a sloppily defined up if you want. So, yes these are all in the world frame correct yeah. I am trying to imagine that the I has been placed into the world frame and I am working with a description of that somebody tells me well the pupils at this location and it is looking at this particular point. In other words that point should be in the center of its image right that is the point L here that would be in the center of the image. From that I make this vector C by just subtracting these two points and then I get the look at direction essentially right like what way are you looking and then the only thing that matters is you know is the camera upside down right side up how exactly is it oriented that is the next part that we are trying to figure out which is handled by this last step. I am taking the up into account here and I just keep performing Cartesian products to get everything to get my coordinated frame orthogonal and right handed regardless of whether somebody gave me a sloppy you value that is not perfectly orthogonal to my other axis. So, it allows you to be sloppy with you personally I would say get it right the first time do not be sloppy about it, but this will fix a little bit of slop in that. So, once I have that I get now a rotation matrix r i where let me just write it out with dots and then these columns this column is just x hat this column is y hat and this column is z hat. So, this gives me a rotation matrix do we agree with that now this gives me a rotation matrix that if I start off with my i defined in its body frame and I apply this rotation matrix to it that I have constructed it should it does not translate the i, but it should not rotate the i so that it is looking in the right direction do you believe that that ok. So, that is what we have if I want to also translate it then I would after performing the rotation I add e the x y and z components to the result I can do it all together in one homogeneous transform. Does this solve our problem of trying to figure out what the perspective of the world is from the i from the i's coordinate frame I think I did it backwards did not I I figured out from the coordinate frame of the world how the i appears I need to do in the other direction how do I solve that all right. So, let us see if I am you know I am standing here I turn my we talked about this before I turn my head let us say counter clockwise 45 degrees it how does the world appear to have moved from the reference point of my i if I hold my i still it appears that the world has rotated in the opposite direction right it is an inverse transform. So, that is what we actually have to apply we do not want our i we want the inverse and we do not want the translation e we want the inverse and. So, the way to imagine it is as if your eyeball is being held fixed and it is the world that is moving around all the time quite wildly I guess because if I turn my head quickly it would take a lot of energy to move the world around that fast right. So, it is a bad relativity problem right, but that is that is how the mathematics feels like when you perform these transformations. So, the i is being held fixed all the time because the screen is being held fixed in relative to the i you are going to be presenting images to that ultimately. So, this is being held fixed and the world is being transformed. So, we need the inverse now remember I just gave you a warning about taking the inverse of one of these transformation matrices. So, let me give you the inverse now and then we will stop and take a break which I seem to have forgotten to do I got a little too excited. So, let us see. So, let us give you the final result. So, T i is equal to I need to I need to have as the columns x hat y hat and z hat sorry I need to have as the rows I said columns is wrong I need to have as the rows x hat y hat z hat because I am performing the inverse transform. Also I need to extend this because I am not just going to apply rotation here I am going to put it together in homogeneous form. So, this is just the rotation part this corresponds to that r i there transpose which because it is a rotation matrix this corresponds to r i inverse and then I have the remaining components and I make this. So, that undoes the rotation and then I have the undoing the translation part which should have my negative e coordinates here negative e x negative e y and negative e z right. So, I have inverted the placement of the I I undo the translation which is this matrix here it is on the right. So, it gets applied first and then I undo the rotation which is the transpose of the rotation matrix that we built using the look at. You do not have to build from a look at you may get it directly from a filtering algorithm that is doing head tracking right. So, it may come from another place, but traditionally in graphics it comes from a look at. So, I wanted to build it from that as well, but it may just come directly from the from the tracking and it may come from some combination of the two as you move a controller around. So, it will come from different sources it is not a constant, but once it is given and fixed this is how you obtain T sub i. Questions about that? How do you find? What do you find the rotation matrix? Oh I think I just did it. So, I mean I basically if you remember when I was covering 3D rotations. In fact, when I went all the way back to 2D rotations I was trying to convince you that the columns correspond to how the coordinate axes get rotated right. I did that in the 2D example and the 3D example was the same way that is why we had these constraints remember when I was saying the columns have to be orthogonal. So, they have to have a inner product of 0 and they have to have length 1. So, these are how the coordinate axes are transformed by the rotation. So, I figured out what these are by the geometry of the look at and then I just write these directly into the matrix and that automatically forms the rotation. So, it is a very good question and it is a very easy thing to forget, but whenever you look at a rotation matrix remember that the columns are these are the coordinate axes normalized and showing exactly the effect of this rotation matrix on the standard basis elements. So, if you take the x, y, z basis elements that are 0, 0, 1, 0, 1, 0 and sorry I should start like you go right in order. If you take the basic coordinate axes 1, 0, 0, 0, 1, 0 and 0, 0, 1 transform the 3 of those with this rotation matrix you will get exactly the expressions in these columns. So, it is just a direct step. Long answer for a short question hopefully it is clear.