Transcript for:
Three Dimensional Transformations in Graphics

Om Sahana Babakum Sahanaubhunathu Sahaviryam Karavavahai Tejasvinavaditamastumavidhvishavahai Om Shanti Welcome back to the discussion on three dimensional transformations on the course on computer graphics. In the last two hours we have discussed various types of transformations in three dimensions, notably rotation, reflection, translation, scale and shear. And then of course, we have moved on towards the projective transformations that is orthographic and perspective projections. We have taken a few examples of special cases of projections basically with respect to perspective transformations and we have seen the scenario of the projection plane and the center of projection or the PRP projection reference point and we had seen equations which can be written and the corresponding transformation matrix in perspective projection. We have to look for a generalized formulation of the projective transform specifically with respect to perspective transformations and which we are going to start today and if you look at this.

screen you have the picture which gives you the very general scenario of perspective transformation or perspective projection specifically where with respect to the screen you have the X and Z coordinates or the Y and Z, you can take right handed system. So if X is the vertical axis and Z axis is moving from the origin O towards the right you see in the picture and the vertical axis is moving from the origin O towards the right. is X, then of course what you will have is the Y axis will basically point towards you.

And of course if you take similarly the Y axis to be vertical, then X axis will point towards you. So we are basically projecting onto a two-dimensional plane which is the screen and this entire three-dimensional picture is what you have to view. And the projection plane, PP is the projection plane which is perpendicular to the Z axis.

So this is the The normal to the projection plane is now the z-axis itself and the projection plane is also along the xy plane. And since we are looking at xz plane, both the xy plane and the projection plane will appear as only lines to us. Now we have assumed that the projection plane is at a distance zp with respect to the origin along the z-axis. That is the distance from the origin to the point of intersection of projection plane and z-axis is zp. And So, the coordinates is 00ZP as given in the bottom of the picture and the center of projection or the COP is along a direction vector given by dx dy dz respectively.

These are the direction cosines of a vector from the point 00ZP towards COP and the COP is at a distance q, COP is at a distance q from the point 00ZP that is the intersection of Z axis and projection plane. Actually, you can define a point anywhere in space with respect to any other point provided the direction cosines of the line joining them and the distance is known. So, distance between COP and 00ZP is q and the direction cosines of the vector pointing towards COP from the 00ZP point is dx dy dz as given.

in this screen and the projection has to be taken for a point Pxyz on the right hand side of your screen. This is the point in 3D for which the projection has to be taken. So the projector ray or the projective ray from point P to COP forms a line L and that line L will intersect the projection plane or the P plane. plane at a point say P prime given by the coordinates xP, yP and capital ZP.

This ZP is the same as 00ZP because the projection plane is at a distance ZP from the origin toward the Z axis. So the problem lies that given Q, given dx, dy, dz and given ZP, we have to obtain the coordinates xP, yP, x, y coordinates of the projected point P prime on the projection plane which is basically a projection of the point xyz coordinate, the projection point P with coordinates xyz. So, what are the input parameters of the algorithm?

xyz coordinates of the point P, zp dx dy dz q. So, these are all given to you and the unknown quantity is the xp yp which is nothing but xy coordinates of the projection point P prime. So, this is the picture which explains the generalized formulation or the problem of generalized formulation of prospective projection and if you are not used to the equation of a line in parametric form which is being introduced today for the first time in this course, we will keep on getting this many a times as we keep going along. The parametric equation of the line between COP and P is given as COP plus T times P minus COP.

This is a vectored form of this equation where the parameter of the line P is given as COP plus T times P minus COP. So, this is the equation of the t varies in the range only between 0 and 1. That means if you substitute t is equal to 0, you are basically talking of a point COP and if you take t is equal to 1, you have reached the point P. So as you vary t from 0 to 1, you are moving over the line L from COP to the point P. So at point P on the line L, your t is equal to 1 and at the COP on the line L, other extreme the parameter t is equal to 0. So you can see that the point So, any other point on the line L which lies between COP and the point P, you have the values in the range 0 to 1. Let us look at how you derive the parameter T when the line of intersection, the line L basically intersects the projection plane PP at a point P prime and if we can somehow get that parameter T, since the coordinates of the point P and COP are known to us. If we substitute the t exactly, you will get the coordinates of point P prime.

The only information which is known to us is that the z coordinates of the point P prime is zp. Look at this slide as we go along. The direction as I was telling you, the direction vector from the point which is the intersection of projection plane and the z axis is 0, 0, zp and the direction vector from that point 0, 0, zp to center of projection or COP be the direction cosine is given as dx dy dz and q be the distance from 00zp to cop.

So, I can express cop also as a vector addition of 00zp plus q which is the distance multiplied by dx dy dz. If you have noted down the figure, please I hope you have copied the figure. I am displaying the figure once again. So, I am expressing COP as a vector which is 0, 0, Z, P plus the Q vector multiplied by the direction cosine dx divided by Z. Q is a scalar quantity.

So, that is how COP is expressed here. So, we will keep going back and forth to the figure and coming back here if necessary. So, the coordinates of any point on line L can be given as x prime, y prime, z prime as Qdx plus x minus Qdx times t.

and similarly y prime and similarly z prime. How do you get this? You get this basically because when we go back to the figure, you have seen the expression of the line L and the COP is now known. We have defined COP as 0, 0, z, z, p vector plus q times dx divided by dz and p is known.

So, using this information with little bit of mathematical manipulation here, you can actually find the coordinates of any point. on the line L as thus given in the expression here as x prime, y prime and z prime. And remember q is known to us, dx, dy, dz is known to us, zp is known and z is also known that is x, y, z coordinates of the point p is known. The left hand side is all unknown, x prime, y prime, z prime is unknown, t is the unknown parameter. As you vary t you know from the two extreme the two values of the t.

But we know one more fact which we are going to put now using the condition that which I said just now that the value of Z prime becomes equal to Zp at the intersection of the line L and the projection plane Pp. The line L and the intersection of the plane Pp basically gives you the projection point P prime and that has a Z coordinate Zp. So, that much is known to us.

So, we use that constraint and put it on the third equation where z prime is equal to z p at that point and that helps us to obtain the value of this. So, basically what you do is you use z prime is equal to z p, substitute it here on the z prime third equation and then you use that to obtain the expression of t which is given in the bottom left of the screen. So, this is the value of t at which the line l intersects the projection plane.

So, that is the intersection point, the value of t and use this t value to substitute in the first two expressions of x prime y prime and what you get basically is nothing but the coordinates of xp yp. Please work it out yourself where you can obtain these first of all these three equations x prime y prime z prime from the previous expressions given in this slide and in the previous slide and then of course, on the third equation put the constraint z prime equal to zp obtain the value of t as given here. and you now substitute to obtain the value of x prime y prime as your xp and zp. So, I will substitute that and give you the final result. Please note down yourself.

You have to work these mathematics out yourself. x prime y prime and z prime first is the expressions, then the value of t, then you substitute the value of t on to the expressions of x prime y prime and you get your x prime y prime value as given here is in xp and yp. I will hold for a moment, place you can copy down the values of x prime and y prime.

of xp by p which you will get by substituting from the in the previous slide the value of t on to x prime y prime. I go back to the previous slide for second, I am talking about these two equations x prime and y prime substitute the value of t as given here on the on to the first two equations and you get x prime y prime as your xp and yp and these are the corresponding expressions. So, these are nothing but the solution for the generalized problem.

formulation of the perspective projection. If you see on the right hand side as we talked earlier all the parameters and values are known. What are the values known? x, y and z are nothing but the coordinates of the point in 3D. d x, d y and d z are the direction cosines of that vector from 0, 0, z p towards point COP and of course you also know z p which is the intersection or the distance of the projection plane from the origin or and that is the vertical distance basically zp.

So, and q is also known because that is the distance of cop from the point. So, all the parameters on the right hand side are known, you can substitute and get the values of xp, yp and those are nothing but now the values of your coordinates of the 2D projection of the point in 3D. From 3D to 2D this is the generalized formulation.

We look at some, now when you go back to the generalized transformation matrix and use the expression as given in the previous slide of Xp and Yp, you will be able to obtain, you should be able to obtain the expression of the generalized transformation matrix. I give this as an exercise for you. Please try it out.

All these expressions you have to write out, otherwise you cannot derive it, otherwise you will easily lose the concept and you will fail to understand the concept. So, what you must do is you must write these equations, draw the figures yourself, understand the vector equations, parametric equation of a line is what you have to use and then you from the expressions which you have got as xp and yp you have to get the generalized transformation matrix M general as given here. So, this is the form you can please note down the values here. So, p prime is M times p where M is a transformation matrix generalized formulation of the prospective projection matrix. and if you use this generalized formulation which will help you to obtain the 2D coordinates from the 3D points.

So, projection of a point in 3D on to a 2D plane generalized formulation is given here by M. General. I hope you are able to copy the corresponding elements of this matrix which you should try to derive yourself. Of course, these have been all been borrowed from the book by Foley, Van Damme, Feynman and Hughes.

We will look at some special cases from the generalized formulation of the prospective projection matrix where the matrix type can take special forms and shapes depending upon the values of Zp, Q and the direction cosines dx, dy, dz. The first row talks about the case when the Zp is at the origin. So you have moved the projection plane at the origin, Q is at infinity. Q is the distance that means the center of projection now has moved to infinity. If the center of projection moves to infinity, we know that the projective rays from the point towards the center of projection passing through the projection lane will all be parallel.

Hence, the transformation matrix becomes an orthogonal matrix and hence we have written m-orth. That means it is a transformation matrix for orthogonal case and the direction vector dx dy dz will also take the form 0 0 minus 1. 0 0 minus 1 form of dx dy dz is also same for the next two rows. Basically 0 0 minus 1 type of unit vector if you see is nothing but a vector which is looking towards the minus z axis. And your view is along the positive z axis and the direction vector.

from the projection plane or the plane normal towards the center of projection is 0, 0, minus 1. So, we have understood what is M orthogonal matrix from a generalized formulation. Second, if you take Zp equal to d, that means wherever it was earlier, q is also equal to d and the direction cosine 0, 0, minus 1, we get a special case of a prospective projection matrix where my COP is at the origin now and the projection plane is at distance d from the origin. and the surface normal of the projection plane is pointing towards the minus z axis, you get the special case of simple perspective projection matrix and these expressions we have already derived earlier in the previous class. A special case of M prime bar dash is the case when zp is equal to 0 and q is at d.

That means the projection plane is now at the origin and the center of projection is also at the origin. d and if that is the case you get a m prime. I expect you to obtain these special cases of these matrices by putting these constraints and you get them basically by substituting these conditions on the terms on the elements of this generalized matrix.

Substitute them and get the special forms of the matrices type of orthogonal and perspective. If the And the last point to be noted here is of course if Q is finite which is the case of perspective projection matrix. When only Q becomes infinite we are talking of orthogonal, otherwise when Q is finite we have perspective projection matrix.

The rays converge at a point, the rays are not parallel at all. The generalized transformation matrix defines what we call as a one point perspective projection in the above two cases. Above two cases means the last two cases as given in the three different cases, special cases in the table here. I hope you still remember the 1 point, 2 point and 3 point perspective projection systems in perspective projection. We move, come out of perspective projection, we have discussed at length today and also in the last class and move towards the case of parallel projection.

I must remind here that you must work out all those expressions which are given earlier for the generalized transformation of the matrix and in the case of parallel projection We know that the constraint is that the distance from the COP to the projection plane is infinite. The distance from the center of projection to the projection plane is infinite. Therefore, if this is the case, what happens basically is the projectors or the projective rays all become parallel lines and hence we need to basically specify a DOP or a direction of projection as given in the slide here.

Since the COP has vanished to infinity, we do not need to specify the coordinates of the center of projection. Instead, the direction of projection is very important. Basically, it is nothing but the direction cosines dx, dy and dz.

A special case of parallel projection, we have seen different types of perspective and parallel projection. We have seen a chart, we will see that shown. It is basically the orthographic projection which is very important to designers of graphics and we say here that the direction of projection and the normal to the projection plane are the same in the case of orthographic. That means the direction of projection is normal to the projection plane. If it is not also it may become parallel, but it may not become orthographic.

Let us look at this chart again which I was talking about. We had shown this in the previous class also. Parallel geometric projections are of two types. I repeat again parallel and perspective.

Perspective are of three types 1 point, 2 point and 3 point. We had discussed this all in the previous class. last class itself and also the generalized form today. In case of parallel, typically I will say there are two broad classes. One is orthographic, another is oblique projection as given here.

One is orthographic projection, another is oblique projection here and orthographic again could be four types. The top view, front elevation, side elevation view typically used by most architects and civil engineering drawings and mechanical drawings as well. And of course also it could be we can have an axonometric view or an isometric view.

We will see an example where we talk of a top plan front elevation and side elevation together of one type of orthotropic projection. We will also see a case of axonometric or isometric. isometric type and we will see the oblique type projection also. Oblique type could be also two or more types cabinet and cavalier, but again probably we will not discuss in details the two different types.

Only we will discuss what is oblique type and how it is different from axonometric or isometric type and that is again how it is different from the front, top or side elevation. So first we will move towards orthographic projection, talk about top, front and side elevation views, then move to axonometric, isometric one example leads. and at the end we move towards oblique projection.

This is an example of an orthographic projection which shows the three types of views which you can generate for an object. I was talking of a top view, a side view and a front view. So here you see typically a structure which looks like a house with a tapered roof. It is basically you can visualize that I have as if put a rectangle at the bottom and then of course a tapered roof. prism type of a structure on the top.

So that is a combined structure and if you look at the structure from the top projection plane, as you have seen that the projection projected rays or projective rays are all parallel coming out of the object and intersecting the projection planes, the projection planes are all grey in colour. There are three projection planes. There are projection planes for the front view, there are projection planes for the side view and the projection plane for the top view. So top view is the top, side is on the side and the front view is the top.

to the left of you. So there are three planes and as you can see here the projectors for the top view, front view and side view respectively they are all parallel. I mean if you take a group of rays for the side view only or only for the top view or for the front view they are parallel to each other and they come out of the object and intersect the plane and they keep moving towards infinity. They are all parallel to each other. They will never intercept and as you can see here that you can get the three different types of views depending upon whether you are having a top view or a front view or a side view of the object.

This is a visualization which you must be able to see for yourself. If you look from the house from the side, typically you will have a side view as given here on the right hand side in the gray color projection plane of the side view. If you look from the top, you will have the view as given on the top view.

You will have the line in the middle and two on the sides and similarly from the front plane, you typically have the cross sectional view I should say. Also, from the side view or the front view, you typically have a cross sectional view where you have a square and then a triangle on the top of the cross sectional. You see from the front, from the side, of course, you will have two rectangles side by side adjacent.

So, these are simple examples of orthographic projections of top view, side view and front view. You can in fact, given an object which is very regular in terms of a geometrical shape, I am sure almost that you should be able to, you should be able draw the corresponding side views. This is a fundamental concept which is taught in almost any drawing class in engineering disciplines and you should be able to generate the top view, side view and the front view for any given figure either it is circular like a cylinder or a sphere or it could be a rectangle or a cube or a cone or a pyramid.

Regular geometrical shapes if you take you should be able to draw the corresponding views. I will leave it as an exercise to take other shapes. Here it is a a planer object which you have been taken, but you can take a sphere or a cone or a cylinder and please try to attempt to draw the corresponding three views for orthographic projection. The other type of orthographic projection was basically the isometric view or axonometric view. They are almost similar.

As you can see here, the projector rays are parallel all right, but the projection plane is at an incline in the sense that it is not aligned with any of the xy or z axis or any of these xy Cartesian coordinate frames and the projection plane normal. We assume at least in this case of isometric projection, we will define what is this, although I have shown the figure and the projector rays and the projection normal are parallel. Let us look at the definition of axonometric and isometric views. First axonometric orthographic projection, remember orthographic type projections had a side view, front view and a top view and then axonometric.

They use planes of projection that are normal to a principal axis, that is what I was talking about. So, the normal to the projection plane. is not aligned with any of the three principal axes x, y or z.

x, y or z axis is not aligned with the direction or the normal of the principal axis and therefore you can or you should be able to see multiple faces of the object using an axiometric projection. What is the special case of axiometric in terms of isometric projection? It isometric projection is a special type of axiometric one where the projection plane normal makes equal angles with the principal axis. That means the direction of projection vector is given as or it could be respectively. It means that the projection plane normal makes equal angle with each of the principal axis.

So if you take the projection plane normal, it seems to be coming out from the origin. It is neither along any one of the three principal axes x, y or z respectively and it is coming out intersecting the plane and pointing towards you. We will just go back and have a look at this figure. This is what I was talking about isometric projection here and the projection plane normal is making equal angles, direction cosine equal angles with respect to all the three principle X, X, Y, Z and as you can see now here with this type of a hollow cube which I am visualizing with isometric projection, you are able to see more than two or three faces.

Typically when you take a top plan or a side view for a cube like this, you will be able to see one or two faces. mostly, but in this case as you can see, you can almost see about 3 to about 4 faces of the cube depending upon if it is solid. You will see only 3, but in this case if it is a hollow you will be able to visualize that you are actually seeing 4 faces of the cube, 2 from outside and 2 from inside.

So we talked of this definition of axonometric projection and then isometric projection and the last word about this is that all 3 axes are equally foreshortened. allowing measurements along the axis to be made with the same scale. This is a special case for axiometric projection, I am sorry special case of axiometric projection which is isometric where we know that the projection plane normal makes equal angles with each of the principal axis and the first criteria of the definition of axiometric projection also holds good. That means you use planes of projection that are not normal to your principal axis.

So you can place it anywhere but in axiometric but the special case of isometric it must make equal angles. What must make? The projection plane normal must make equal angles with the three principal axes x, y, z and typical example is the directional projection vector which is nothing but you can say this is also the projection plane normal is given as 1, 1, 1 and all the three axes or the dimensions of the object along all the three axes appear to be equal and same for the isometric projection.

So, this is the isometric projection. This was a different type of orthographic projection unlike the orthographic case. Orthographic had top, side, plan and axonometric and isometric as well which is a part of isometric. So these are the categories of orthographic projection under parallel and we had seen in the chart earlier that parallel projections could be classified under two broad categories again one was orthographic other was oblique. So we have seen the various types of orthographic projection, top I repeat again top view, side view and front view.

and also axonometric, those fall under the category of orthographic projections. And the other type of parallel projection is the oblique projection which says as you see on the screen, you see that the projection plane normal and the direction of projection they differ. This is very unique in the sense that you are going to have almost for the first time a scenario where the projection plane normal and the direction of the projection are not the same. In perspective projection and in orthographic under the category of parallel projection, always we had a scenario.

where the projection plane normal and the direction of projections those two vectors were the same and they coincided. But in the oblique projection we have a funny case where the projector rays which usually intersect normally intersect with the projector rays with the projection plane in all other type of projection models does not happen in the case of oblique. So you can take a plane and instead of projector rays parallel intersecting the projection plane, they intersect at an angle.

So the plane normal and the direction of the projector rays, they are not parallel anymore in the case of an oblique projection. We will see with an example a few more points. So plane of projection is normal to a principal axis.

So we come back to the forms of the special type of orthographic projections as a stop. plan side etcetera or even prospective projection where the planar projection is now made in such a manner that it is normal to a principal axis or the projection plane normal itself is one of the principal axis and the projectors, but the projectors are not parallel to the, I mean sorry they are not normal to the projection plane. Earlier projectors were moving along the direction of the normal to the projection plane, but they are not anymore.

So, how do you visualize this figure? Let us look at this figure. I hope you will be able to understand this figure where the projection plane is the grey colour rectangle and we are again taking the projection of a cube, it is a hollow cube again, it is easy to visualize if you take a hollow cube because you can see the inside lines as well and the projection plane normal is the z axis.

The projection plane normal as given the bottom of the screen as a vector here is aligned along with the z axis or parallel to z axis and the projection plane normal is nothing but now the xy plane, correct? The projection plane normal is hence the xy plane and but it is interesting to note now here that the projector rays are not parallel to the z axis. They are neither parallel to z axis nor the projection normal. This was not the case of any other type which we had seen in orthographic odd perspective but in oblique that is why the term oblique comes that the projector rays now come and hit the projection plane at an angle.

They are inclined. They are not normal. They are not normal, they are not parallel to the projection plane normal, they are not parallel to the z axis but they hit on the projection plane at an incline and this is what gives you what is called as an oblique projection. Yes, it could be useful in certain cases but difficult to typically derive expressions but you must know the type of oblique projection as given here.

Just to give an idea of the formulation required for the generalized oblique projection of a point or a line. If you look at this figure, what we are basically trying to do is that we have taken the projection plane to be the xy plane, we have taken the point to be projected on the z axis, a point P given with coordinate 0, 0, 1. So, it is at the z axis, on the z axis and we intend to project this point through a line on the xy plane which is the projection plane and intersection of that line with the xy plane. projection pen will give you the projection P prime. In fact, this point will project there, the entire line will project into a line which will join the origin O.

I have not marked the origin, but you can visualize the intersection of the three principal axes X, Y, Z to be at the origin. So, the line joining the origin to the point P prime, which is marked as italicized L, is the projection of the thick line O. or the 3D line onto the projection plane. Remember it is an oblique projection and that line L makes an angle alpha with the x axis. It also makes an angle beta with the line in 3D.

This is what you have as the oblique projection of a point or a line. Maybe we can write a few equations on this as we had given earlier. The projection plane as I said before was an xy plane.

I hope you have drawn the previous figure. If not, please draw it. I flash it again here.

So, xyz then the point, projected on the xy plane gives you the projection p prime and so the projection plane is the xy plane, p prime is the projection of a point in 3D onto the xy plane and L is the projection of the z axis unit vector onto the xy plane. I must say here, that L is the projection of the z axis unit vector not that projector line which I was talking about. So you can take a z axis unit vector and projection of that onto the xy plane because you have to send projectors which are all parallel to this thick line joining P to P prime.

One such projector ray is given as P to P prime. You can take any other projection point, the projectors will be all parallel to this line and they will hit the xy plane. So I must rectify myself and say that the L is the projection of the z axis unit vector onto the xy plane and alpha.

is the angle the projection makes with the x axis. That part is okay. So what is the direction of projection here?

When direction of projection varies, both L and alpha will vary and what do you mean by this that the direction of projection will vary? We will just go back.. See, directional projection is nothing but the thick line joining P to P prime. So if you change this line P to P prime, what will happen is basically you are changing the directional projection.

Directional projection is the vector from P towards P prime. So if we change that, of course L and the corresponding inclination angle alpha both will change. So that is what is talked about here.

So when directional projection varies, both L and alpha will vary and the coordinates of the P prime. The projection point of P on the xy plane or the projection plane can be written as L cos alpha L sin alpha 0. That you should be easy to derive if you look at this figure. The projection point because if this is L and if you take this right angle triangle with the hypotenuse as L and this is the alpha, so you will get the coordinates of P prime as given here as L cos alpha L sin alpha and the z coordinates is 0. So this much at least we can write and as given in the figure. The direction of projection can also be written as dx dy minus 1 where dx dy are nothing but direction cosines given as L cos alpha L sin alpha minus 1. This you should be able to derive yourself.

I repeat again direction of projection is nothing but the vector joining the point P to the point P prime. So you are looking at this vector here. So you are basically looking at from towards L cos alpha L sin alpha 0. So if you substitute this subtract one vector from the other you will get the values as given here at the bottom of the screen as L cos alpha L sin alpha minus 1. So, this is how the directional projection is given and the rest of the values can be obtained from the figure here.

So, this was the figure which we were talking about. So, directional projection can be found out or given directional projection also we can find L and alpha the reverse and of course I leave it in exercise for you. As a problem to solve what is the angle beta?

What is the angle beta? Beta is the angle between the direction of projection and the xy plane. Direction of projection and the xy plane, if the direction cosines of the DOP is given to you, I think that is enough for you to find out what is going to be the value of beta. So, this is another problem I am giving to you. I am not solving all the problems because I thought I should leave something for the student to work out.

Although there will be a list of problems, but still you should try to solve them. solve this problem out from the angle from the beta. Given the previous expressions here, all expressions given in this, if you have noted down, you should be and understood the figure, you should be able to calculate the beta. Now, just a few specifications left for to describe various specifications in terms of perspective and orthographic projection. That means when you try to define a three-dimensional view, what are the parameters of that view?

you need to define. There are various types of parameters which are used for a generalized projection matrix and given these parameters, given the object, the graphic software should be able to calculate and tell you or you should be able to write programs which will give you the corresponding projection. I will go through the terminologies which are given here. The view plane Vp, the first one which comes is the view plane which is given in the big rectangular box and the view view reference point VRP is the center on which you have the three axis coming out. The VRP is a point on the view plane.

VRP is a view reference point on the view plane VP. I have not written these corresponding terminologies but as I say keep writing down yourself VP is the view plane, VRP is the view reference point, VUP is the view of vector. VRP is the view reference point and VUP is the view up vector. I will define what is this up vector.

It is very important in 3D space to define what is up for you. What is up which with respect to the up vector you can define your right, left and bottom because in space basically you may lose your coordinates and you will not know what is top and what is behind and in front of you and things like that. So, you need a view up vector and a view and the next terminology is VPN or view plane normal which is this vector as given here VPN is VUP.

plane normal. PRP is already you have seen projection reference point, DOP also you know direction of projection, this we have seen. CW is centre of the window, that is the centre of this window in the view plane or the viewport.

You can define a sub window of the view plane within which you will put all your, in which you will all draw your figures and the centre of window is exactly the centre of that small window, the grey colour window within the view plane. that is the center of window CW and VRC is nothing but the view reference coordinate system which talks of u and v instead of xy in certain cases. Remember the view plane normal is along the vector normal n which is normal to the projection plane or Vpn, they are same and the center of window which is the center of the viewport as it is called the small rectangle running from coordinates umin vmin to a maximum of u max v max in the uv coordinate space. uv coordinate space is defined to define the view reference coordinate system on the view plane.

So these are the terminologies. If you have missed anything I repeat again Vp is view plane. VRP is view reference point, VUP is the view up vector, VPN is the view plane normal, PRP and DOP are known to you earlier, CW is the center of the window and virtual reference coordinate system or view reference coordinate system is VRC. So these specifications once it is given a complete three dimensional projection geometry is defined and now objects in 3D can be projected on to the view plane. plane Vp or even the window which is defined between Vmin to Umax Vmax.

If these are defined with respect to the COP or PRP, center of projection or projection reference point, you can define a semi-infinite pyramid view volume for prospective projection. We said that rays come out from the object, intersect the projection plane and meet at the COP. You can visualize the other way around where rays come out of the center of projection, they come out, intersect the projection plane and goes towards the object. Basically the rays, the light rays from the object have to come towards the projection plane and these rays are not parallel anymore.

When you talk of perspective projection, they are parallel in the case of oblique, orthographic or parallel projection, but in perspective projection these rays meet at a point called the COP or PRP. So, from the previous figures we know what is a VP which is the view plane, we know what is the view plane normal, we know what is the center of window, we know what is the VRP or the view reference point and we know the virtual coordinate system and the COP. So, this type of structure defines a rectangular base pyramid which is a semi-infinite in the sense that you can try to visualize that these rays form an infinite pyramid in one direction and all objects in that in. pyramid which is infinite in one direction only forms the view volume of your perspective projection.

You can visualize a pyramid with rectangular base, you can keep drawing away the view plane away from the COP and the volume which you get is actually now called the pyramidal volume is semi-infinite because infinite only in one direction and this is how you define what is called as the pyramid view volume for perspective projection and it is semi-infinite. Just to describe once again although we say it is a semi-infinite but to make matters easy for the graphic user or the graphic designer we define we make the semi-infinite pyramid a finite pyramid view volume for perspective projection how do you do that okay with that semi-infinite pyramid i define what is called a front clipping plane and a back clipping plane okay we talk of clipping later on but here you can visualize that the the objects which are now all within the the volume between FCP and BCP that is front clipping plane and back clipping plane which will intersect the pyramid and create a finite view volume for prospective projection, those objects will be visible. They should be between the FCP and the BCP. It should be between the front clipping plane and black clipping plane because nothing on the back side of the back clipping plane is visible, nothing on the front side is visible to you and of course you can put your VRP and the VP that is the view plane and the view reference point. in between anywhere between the, you can actually keep it even in front or outside this range between FCP and the directional projection is you see is also marked.

It is actually normal, but in the reverse direction of the view plane normal. This is the case of a finite pyramid view volume of perspective projection. And I go back to the previous slide, this was the case of a semi-infinite pyramidal view volume and this is the case of a finite.

So you can visualize yourself both the pyramidal structures, one is semi-infinite or almost infinite and this is a finite view volume. This finiteness comes from the two planes, the front clipping plane and the back clipping plane respectively. Coming back to parallel projections, infinite parallel pipette view volume can be defined with respect to parallel projection.

Now the rays which were converging out with respect to the COP or PRP in the case of perspective projection are parallel now. In the case of a parallel projection which could be orthographic or it could be oblique. Typically, it is only visualized orthographic type of projections here. The COP has vanished to infinity.

You do not see a COP. There is no central projection because the rays do not go through the central or you can say that the rays meet at infinity. Since the rays meet at infinity, the rays are all parallel and they are also normal to the plane.

If you see the normal N, the view plane normal which is also normal to the orthographic projector rays which are parallel, this is also parallel to the direction of projection running from PRP to the center of the window. You can define the direction of projection here. the direction of the projection is the direction through which the rays will be travelling. They run from the PRP to the center of the window or towards the view plane and that defines the DOP. It is also parallel to view plane normal but in the reverse direction view plane normal is parallel to a direction N which you can specify earlier and the VRP could be defined anywhere on the screen.

It may not be only on the CW or the center of window. It could be the VRP is defined in this case in the bottom right of the screen. It is all You are free to define these coordinates but of course certain constraints and they should be all consistent with respect to each other.

The VRP could be anywhere in the view plane. Center of window is the center of the viewport, the grey color central window and the line joining PRP, the center of window is the direction of projection. So that is the infinite parallelepiped view volume.

Why infinite? Because if you see I have drawn four such rays which are intersecting the projection plane normally. and they move on both directions towards infinity and you can visualize that I have got a rectangular parallel pipette of infinite size. So the depth basically there is a height or the length and a breadth but along the z-axis or along the direction of projection it is infinite.

So that is an infinite view volume like an infinite pyramid which we had in the case of perspective. Now this infinite pyramid becomes an infinite parallel pipette in the case of parallel projection. Just to define it more.

in a better form. Well, that infinite parallel pipette can be made a finite parallel pipette. As in the case of perspective, we remember we had a semi-infinite pyramid, we made a finite pyramid out of that.

Similarly, here also we can make a finite parallel pipette view volume VV is also the term used for parallel projection and like in the previous case, we also can have a front clipping plane and a back clipping plane, the FCP and the BCP. which sits in front of the VRP and on the back side of the VRP or rather the view plane. So you have the FCP or the front clipping plane on one side of the view plane, you have the back clipping plane on the other side of the view plane and all objects within this finite view volume that is the view volume defined by the front clipping plane, back clipping plane and the corresponding dimensions if you visualize all sitting within that box, objects within or all points, lines and objects and surfaces within that particular view volume will all be visible to the viewer on the view plane or the window or the viewport which you define and all objects which are outside, all objects which are outside this view volume will not be visible. So it is always good to define a finite view volume either in the case of parallel or perspective so that you know what are the range or the dimensions range of values along each xy and z directions which are visible to you.

Of course if you take a digital camera or if you are seeing through your own eye you know that only a finite range of the world is visible to you and that too in front and a little bit to the side and top and down. You may not be able to see definitely what is on the back side of you. You may not be able to see objects which are too far from you on the front side and also definitely on both sides if they are highly oblique. to the left and right side, if there are two extremes, you will not be able to see the object. So you always see, of course in the digital camera and in our eye we have a perspective nature of viewing, but either perspective or parallel you always see a finite region in space or in the world, whatever.

And henceforth you always have a back clipping plane and a front clipping plane and of course the two dimensions on two sides, you will not be able to definitely see what is back to you. So, with respect to this point I would like to wind up the discussions on three dimensional transformations and move on to the next lecture which will basically an extension of three dimensional transformations, but I have given it a different name which will be going towards three dimensional viewing and clipping. Although there is a separate chapter on clipping algorithms but three dimensional weaving geometry and all that I thought to keep it separate out from three dimensional transformations.

We will discuss that in the next one or two classes as we go along. But before that please I have given here a list of problems and exercises which you should try to solve based on the last two to three hours of lecturing which we have done so far. We went along of course also I have been stating problems to you which you should work out all these mathematics which is given to you. You should draw those diagrams yourself, you should try to derive those equations, expressions for the generalized transformations of all the matrices in terms of specifically rotation, reflection and perspective transformation matrices you should derive all those expressions yourself and then only you will get the confidence at least once or twice. In addition to this I must also mention here that I have given a few more problems which you can work out.

I will just read out these problems. The first problem says, illustrate the vanishing points for the projection of a transparent cube in case of three point perspective projection. Remember as we went through this lecture we talked about one point, two point and three point perspective geometric or projection models, but I have only given figures for one point.

point projection and two point projection systems. So, you will be able to visualize now what will be the scenario of the projection plane such that you obtain in the case of a cube a three point prospective projection. Visualize this and then try to draw and take a sheet of paper and try to draw projective rays, get the intersection points on the projection planes and then try to obtain the three point, three vanishing points in the case of a cube for a three point prospective projection. Question number 2 says, obtain the expression of the elements of the matrices which provide the generalized transformations in case of rotation about an arbitrary axis and reflection about an arbitrary plane.

Now, I have given the expression in matrix multiplication form and I have given and worked out may be two classes back the expressions of the elements of each of these matrices. Remember we had a composite form which composed of translations, expressions and reflection also in question 2B. but I have not taken those two expressions and multiplied all those matrices and obtained a fundamental.

Please do that, it will give you lot of confidence both in terms of matrix algebra and also in terms of matrix manipulations with the elements and also confidence with respect to this aspects of three dimensional transformations here in computer graphics. And so take those expressions which are given there separately, take the composite form, separate one by one, sequentially keep multiplying. and obtain all the 9 or 16 elements if the 3 by 3 or a 4 by 4. It could be, you could do this in 2D as well. You can do this in 2D of course, in 2D rotation is about a point and reflection is about a line.

In the case of 3D, we remember the rotation is respect to an arbitrary axis, generalized transformation I am talking about and reflection will be respect to a plane. So, plane and an axis in 3D becomes a point and a line in 2D. You can, if you find the 3D transformation matrix too big, you can go back to 2D. take the generalized transformation matrices in 2D and try to get the expression of the matrix.

I have given these separate forms, please multiply them. A special case of question 2 is question 3 where I am asking you to obtain the matrix which is a multiplication of that obtained in 2A and 2B. So whatever answers you get in 2A and 2B, multiply them and get another matrix which, what will this matrix give you? Yes, this matrix will actually give you a form of...

two successive operations of rotation and reflection, generalized one. That means if you want to rotate about an arbitrary axis and then reflect about an arbitrary plane or even it could be vice versa, you can just reverse the transformations of 2a into 2b or 2b then 2a, whatever the case may be, the answer which you get in question 3 will give you the generalized transformation matrix which involves a composite matrix of two generalized transformations. What are those? Two generalized transformations in sequence, rotation about an axis, reflection about a plane or in 2D rotation about a point, reflection about a line.

So that is question number 3. Question number 4 is a very interesting observation. Take the rotation matrix in 2D or 3D and prove that pure rotation about an arbitrary axis in 3D or a point in case of a 2D can be considered as a combination of another rotation and a translation. I leave this exercise for you to try out.

That means if you rotate by an amount theta, what you basically do is take another matrix where you rotate by an amount which is a fraction of theta or theta by 2 let us say and to reach to the final point which you rotated by theta, you need a translation which you can do because you are talking of a point. We are talking with respect to a point. So, a combination of a rotation and a translation gives you another rotation about a point or any arbitrary rotation can be expressed as, a rotation and then a translation to the final destination point.

So please you can prove that very easily. You can do it in 3D or 2D by taking the rotational matrices. Basically what you have to do is find the expressions of that translational components required to take you to that final point which you would have reached by a pure rotation.

Last question is, obtain the scale matrix along an arbitrary direction. Interesting here because the scale matrix which you have thought of is a generalized scale matrix which will scale in all directions or we have scale coefficients along x, y and z. Now, if I say scale along a vector 1 1 1 or any arbitrary vector I give which gives you the direction cosines along a particular direction and I will ask you to scale along that particular direction. That means I am asking you to derive in the last question a generalized expression or a generalized transformation matrix for scaling like we did for rotation, reflection, perspective transformation. Now, do it for scaling because we have got the scaling matrices form.

cases along x, y or z or all together. So, given along a particular arbitrary direction what should be the scale matrix. Please try to solve all these problems as given here and also the problems which I have talked of earlier. It will give you lot of confidence both in terms of vector algebra, matrix algebra and transformation matrix in both 2D and 3D transformations.

So, we stop here and move towards the next lecture which will be on 3 dimensional transformation and viewing. Thank you very much.