Tip:
Highlight text to annotate it
X
So we have been talking about 3D viewing, the transformations pertaining to 3D viewing.
Today we will continue on it. Earlier we basically looked at 3D viewing as a process where there
is an object AB here and we have a projection plane and what we get are these projectors
emanating from the object on to the projection plane meeting at the center of projection
and this is the process of projection. And in this way we get what we call as perspective
projection. So A prime B prime is basically the projected image of the object AB. And
you notice here that these projectors are not parallel to each other and they are basically
meeting at this point which is center of projection.
Now the other type of viewing projection is the parallel projection where we have this
projectors coming out the object AB parallel to each other and this is again the projection
plane. So, in effect what we get is the center of projection now moves to infinity. It does
not meet at the point which we will call it as the center of projection. So this is parallel
projection and we basically looked at the various types of parallel projections.
For instance, we looked at the orthographic projection where we basically have an object
and the projectors are parallel to each other and they are perpendicular to the principle
planes which are actually planes perpendicular to the principle or the coordinate axis. So
this is for instance gives us the top view the plane which is perpendicular to the y
axis and similarly the front view and the side view we get.
Mathematically we can get this projection again using as a matrix transformation. Therefore
this matrix P basically gives as an orthographic projection on Z is equal to 0 plane. What
we get basically is this third column and all the values are 0. So we can represent
this orthographic projection again as a matrix transformation. So the property here we have
basically preserves the true silent shape for the object. So these are the examples.
Here we notice that these are the projectors, this is the projection plane and these projectors
are parallel to each other and they are also perpendicular to the projection plane and
these are the various views we can get of this object such as the front view, the top
view and the side view.
The next category we looked at was the axonometric projections. These are also parallel projection
meaning that the projectors are parallel to each other. So the way we can look at these
axonometric projections are basically as additional transformation before we apply the conventional
orthographic projection. For instance, we can have additional rotations or translation
and then we have the projection on Z is equal to 0 plane. Now as a consequence if I consider
the unit vectors in the three coordinate axis 1 0 0 1 represented in homogeneous coordinates
0 1 0 as Y axis or unit vector in Y direction and 0 0 1 as unit vector in Z direction and
if I apply a transformation T to it what I observe is and then this T is also consisting
of the projection of Z is equal to 0 plane which basically means that the third column
is going to be all 0.
So what I will get is basically this meaning that this particular unit vector which I considered
will get transformed to this Xx Yx star 0 1 which says that there is some sort of a
foreshortening which has happened to the unit vector which I had considered in X direction.
And the amount of foreshortening is nothing but this distance in X direction. Basically
I just measure these and that gives me fx which is foreshortening in X. Similarly I
get foreshortening in Y and foreshortening in Z. Now depending on the relationship of
these foreshortenings I have various kinds of axonometric projections because these foreshortenings
could be equal or may not be equal.
Therefore for instance I can basically define three types of axonometric projection; trimetric
where no foreshortening is the same. So fx is not equal to fy is not equal to fz. In
diametric two foreshortenings are the same out of these three and in isometric all the
foreshortening are the same.
As an example here we have the trimetric projection where fx is not equal fy is not equal to fz.
This is diametric so you that this basically equals to this if I had taken the object to
start with as a queue. So when we observe the foreshortening these two directions are
the same. And in isometric I have all the foreshortening. What basically happens here
is that these projectors are parallel, these projectors are also perpendicular to the projection
plane. It is just the projection plane which is placed differently as opposed to in the
case of orthographic projection where it was kept actually at the principle planes. So
this basically adds the visual realism to the 3 dimensional object. When you view the
object it looks more like a 3 dimensional object then you would see in orthographic
projection. Orthographic projection in isolation for a particular view does not give you any
3 dimensional information whereas these actually help you viewing in 3 dimension. That is the
basic advantage we have here.
If we are dealing with isometric projection the basic thing is that the projecting plane
undergoes some kind of a transformation before we perform the conventional orthographic projection
on Z is equal to 0 plane. These transformations are of the kind rotations. So, if I use two
rotations the first one is about Y axis by an angle phi and the other one is about X
axis by an angle theta. The corresponding transformations I have given, this is the
rotation about the Y axis and this is the rotation about X axis and then I apply the
projection on Z is equal to 0. So this whole matrix now would give me a transformation
which I want to use as an isometric projection.
This is the resulting transformation I get after concatenating these individual transformations.
It is just a multiplication of those matrices. Now if you go back and see how we obtain those
foreshortenings for the unit vectors let us again try to see these foreshortenings with
this transformation matrix.
Again I have the three unit vectors and this is the transformation. Once I apply the transformation
on to these three unit vectors the modified or the transformed unit vectors are dmos.
So the first row gives me the transform unit vector in X, the second row gives me the transform
unit vector in Y and the third one gives me the transform unit vector in Z. So these are
the three unit vectors transform. Now, from these I try to compute the foreshortening
just in the way I had done earlier. So I get the square of foreshortening in X given by
this which are the square of these two entries I have here.
Similarly I have the foreshortening in Y the square of it given here and foreshortening
in Z. Now I impose the constraint of the transformation to be isometric which in turn means that these
three foreshortenings should be the same which basically means now I have fx is equal to
fy is equal to fz is equal to some f which gives me these two equations.
Now I have these three equations where I can solve it for pi, theta and f. So basically
it can give me the amount of rotations I should be performing in order to get isometric projection
for a given value of foreshortening. Now we move on to the other type of parallel projections.
So what were the observations we had in the axonometric projection? It was that the projectors
were parallel and they were perpendicular to the projection plane. Now we relax one
of the restrictions.
Since these are in parallel projections we will still retain the projectors to be parallel
because we want the center of projections to lie at infinity whereas we relax this condition
that they need not be perpendicular to the projection. So what this gives us we call
it as oblique projection. Here the projectors are not perpendicular to the projection. For
instance, if this is the object and this is the projector I have this is not perpendicular
to the projection. Therefore now with this property the true shape and size will be preserved
only for the faces which are parallel to the projection.
This is again an example here, here these projectors are not perpendicular to the projection
plane. And again the motivation of having oblique projection is to add the element of
3D viewing, to make it look like a 3 dimensional object. So this is the example of oblique
projection.
And mathematically what we can observe here is let us say we have a point P(x, y, z) and
this is my projection plane the (x, y) plane and this is the projector I have from P to
P double prime and now I want to get the value of Xp Yp which are the coordinates on (x, y) plane of the
point P so what I observe is that the projector which is parallel to the Z axis goes to P
prime which gives me (x, y) basically so I can represent Xp Yp in terms of this (x, y).
Hence xp is nothing but X plus L cos phi where L is this length from p prime to p double
prime and similarly Yp is y plus L sin pi using this triangle. So phi is basically the
angle between P prime and P double prime and X axis on this plane. Now the angle which
this projector is making with the projection plane is the alpha. Now for a given alpha
we can get many projectors for the same value of alpha so I have to restrict the location
of the projector and I am doing that using this phi because it basically gives me a cone.
The set of all projectors is basically a cone. Now this alpha is actually related through
Z and L so I have this tan alpha given by Z by L or L is equal to Z cot alpha from this
triangle. Depending on what alpha we choose we get a particular type of oblique projection
for some value of phi by fixing the value of phi.
Then we choose alpha to be 45 degree, the type of public projection we get is called
a cavalier and what we are observe here is that the lines which are perpendicular to
the projection plane are not foreshorten. Remember how L and Z are related. Basically
cot alpha is 1. The lines which are perpendicular to the projection plane will basically have
the same length whereas if I choose alpha in a manner that cot alpha is half the projection
which we obtain we call it as cabinet and here we observe that the lines perpendicular
to the projection plane are foreshorten by half for the same reason what we observe in
this case because they are related by cot alpha. And the five is actually typically
30 degree or 45 degree. So this is basically the oblique projection. So here we observe
that the projectors are at an angle other than 90 degree to the projection.
Now we move on to the more general kind of a projection which also matches to the visual
system we have which is the perspective projection. And in the beginning we observed that these
projectors are not parallel and they actually meet at a point which is the center of projection.
So here parallel lines seem to converge and the foreshortening could be non uniform. And
in fact this perspective projection helps us in the 3D viewing because it gives you
some sort of a depth perception. The front objects seem to look bigger there is a depth
queue and the shape is not preserved although the lines map to lines but the parallelism
is not preserved and the foreshortening is non uniform therefore the shape will not be
different. This is the projection plane and this is the object here and the center of projection is sitting
here. Now let us try to see it mathematically.
Just as we have seen axonometric and orthographic projections even the oblique projection can
be represented in the matrix form because the way you had seen the transformation of
obtaining Xp using Xy you can actually write that in the matrix form. So that can also
be obtained using a matrix form. So now we try to represent this perspective transformation
using a matrix form. Here we have the input given as x y z 1 in homogeneous coordinate
system and this is the matrix we have. In 4 into 4 general matrix of transformation
we have not been considering the last column.
Now let us consider the last column where we put a non zero value in the third row of
this column this r. Now using this transformation the point x y z 1 becomes this in homogeneous
coordinates. So, to get the Cartesian coordinates the normal coordinates which we use for our
purposes we divide it by the homogeneous coordinates all through and we get this X by rz plus 1Y
by rz plus 1, Z by rz plus 1 so this is still 3D. We are basically making a transformation
from 3D to 3D.
Now if I take a projection on Z is equal to 0 plane which basically means I multiply by
this matrix where the third column again is all 0s this would give me this, basically
this value becomes 0. Therefore this is the projected point now after having done the
perspective transformation.
Using a matrix form of transformation we know what we got. Now let us try to see geometrically.
So here is your center of projection along the Z direction Z axis located at Zc and this
is your point P(x, y, z) and we are looking at projection on Z is equal to 0 plane meaning
(x, y) plane. So I basically project this point through the center of projection on
to this plane and I get T star which has the coordinate x star y star and that what is
happening as a process when I say that the point p is projected on Z is equal to 0 plane
from the center of projection located at ZC along the Z direction.
So now consider the properties from similar triangles and try to obtain the values of
x star and y star. Now I consider the similar triangle first this where this is y star which
is already present and this is y which is here. And these lengths are given as l1 and
l2. So using this triangle I can now get the value of y star. Basically y star by l2 is
equal to y by l2 minus l1 and also now using these similar triangles on the Xz plane I
have Zc by Zc minus Z from this triangle on the base equals to l2 by l2 minus l1. So first
I consider this triangle which is there and then I consider these triangles from the base.
So this gives me y star is equal to y by 1 minus z by Zc. Similarly I can obtain x star.
I can obtain X star in a similar way. So X star is given as X by 1 minus Z by Zc.
If you go back and see what we have obtained as x star and y star are these values and
here what we got is X star as X by 1 minus Zc and Y star as Y by 1 minus Zc. So, if you
substitute r as minus 1 by Zc they are equivalent. So this establishes the correspondence between
the two representations what we do geometrically and what we obtain from the matrix. Therefore
if I have r is equal to minus 1 by Zc I basically get the same transformation which I derive
here geometrically. And Zc is nothing but the location of center of projection along
Z axis. Now there is another property which we observe in the perspective transformation.
The fact that the parallel lines seem to converge is being observed. Even in the real life scenario
we observe that the two parallel lines need to converge, there will be tracks and so on.
But in reality they do not converge. So what we get are these vanishing points which are
basically the points where the set of parallel lines not parallel to the projection plane
converge.
Here is an example where if I look at an object like a cube or parallelepiped I see that the
lines which are perpendicular to the projection plane in this case the lines which are parallel
to Z axis seem to converge somewhere else. This is what we call as the vanishing point
in Z direction. In the world this point is located at infinity. It is just that the transformation
which is the perspective transformation making it appear there. So what does it mean? If
I want to know this point I can actually take a point at infinity and apply my perspective
transformation. That will locate the vanishing point corresponding to the point at infinity.
That is what is happening now.
If I consider a point at infinity on positive Z axis, remember the homogenous coordinates
enable us to represent the point at infinity just by using the homogenous part of the coordinate
as 0. So this is the point at infinity on positive Z axis. Now if I take this point
and apply the perspective transformation using this r here in the last column what we obtain is this value 0 0 1 by r1.
This is after homogenizing it after dividing by the last homogenous coordinates I get this.
And recall that this r is nothing but minus 1 by Zc. This is the scenario I am taking
where the center of projection is laying along the Z axis at Zc. So r is equal to minus 1
by Zc which means that the vanishing point which I am trying to obtain here is at Zc.
So it is an image of center of projection on
the other side.
This is after the perspective transformation. But you are trying to locate what image would
it have after the projection then it is going to lie on the origin. This is after the perspective
transformation I am not projecting it on a 2D plane. The moment I do the projection on
2D plane this point will get there because this is along the Z axis. So this is the before
the projection has taken place. In this way I can obtain the vanishing point.
Similarly, this was the example where I had considered the single perspective so I call
the single perspective transformation when one of the three entries here and the last
column of the matrix is non zero. I had earlier considered the third row where the center
of projection was along Z axis similarly I can consider the other axis. Here if I consider
center of projection on X axis then I am taking about a non zero value here p and I have a
very similar treatment which can give me the transformed point x y z 1 as this and correspondingly
the center of projection is located at minus 1 by p 0 0 1 and the vanishing point along
X axis is located at 1 by p 0 0 1. So I call the type of perspective transformation as
a single point perspective transformation when one of the three entries here is non
zero. So this is again when I would consider the second row now I get center of projection
as this and this is VPy.
Now the idea can be extended of single point perspective to have a two point perspective
just using the same framework of values in the matrix. So instead of having one of the
values in the last column to be non zero let us say I have two values P and Q which can
also be obtained by concatenating the individual matrices of one point perspective like Pp
and Pq. If I have just multiplied them I would have obtain this again. This is to get a two
point perspective. So this would give me the two centers of projections and correspondingly
two principle vanishing points.
Now I can further extend this idea where all the three entries here are non zero p q r.
And once again this can be obtained as concatenation of the three one point perspective transformation.
And this gives me three centers of projections and the corresponding vanishing points.
Here this is the example where I have as one point or single point perspective. So these
lines of the columns are still parallel but these lines if you consider this to be as
Z axis then they seem to meet somewhere. Therefore this is a one point or a single point perspective,
this is a two point perspective. So here I still have the lines which are along the y
axis that is still parallel whereas the other ones seem to converge this one and these ones.
So this is a two point perspective and this is a three point perspective and none of the
parallel lines now seem to remain parallel but they seem to converge at some point. Therefore
again the idea of using one point two point three point perspective is to add wherever
required the 3 dimensional viewing in
the object.
What do you mean by two point perspective relating to what happens in the reality because
even when you take a camera there is only one camera from the image perspective. This
is just with respect to the matrix we have. So I basically looked at the entries in the
last column and defined the various types of perspective there and correspondingly what
we get is the principle vanishing points. But we can generate these even using single
maybe a camera. If you actually apply certain transformations before you take a single perspective
transformation you can create two or three point perspective.
So all it is saying is that if you apply a certain transformation to the object and then
you take a single point perspective you may get two point perspective or you may get even
three point perspective. That is the process of generating two point or three point perspective.
There I had considered the location of the position of the object in such a way that
they were aligned to the principle axis and the vanishing points which I am referring
to here are basically the principle vanishing points because so I am looking at the lines
which are parallel to either of the coordinate axis. But you can actually get vanishing points
for the lines which are not parallel to one of these coordinate axis and they still converge
to a point. Hence there might be just vanishing points or sometimes they are also referred
as tracing points.
If you take a point in (x, y) plane, treating it from the representation of a matrix was
to define these single point, two point and three point perspective. When you are generating
them that is when you have to generate such a kind of a projection you may still be using
one camera and that is where your viewer or the camera is located. But you can create
the effect of multiple vanishing points. So let us look at how to generate these perspective
views.
Even when we are talking about the aspect of enhancing the 3 dimensionality in viewing
of the objects a single perspective may not be adequate and that is the idea. For instance,
if I put an object or a cube in such a way that the cube is basically having all the
edges parallel to the coordinate axis and I am viewing from the Z axis then what will
happen is I will just see the front face considering there is a hidden line or hidden surface elimination process going on. Therefore
all I will see is the first front face and nothing else and that would not give me any
3 dimensional viewing so I need to enhance that in some ways. So the way we can do is
we can actually have additional transformation before we apply the single perspective transformation.
Hence let us consider a simple transformation like translation. If I apply a translation
by the offset l m n to the object and again I consider the center of projection located
at Z is equal to c and the projection plane Z is equal to 0 then I just concatenate these
two matrices the translation matrix and the projection matrix and this is what I get.
So the example of this, if I consider the translation along y is equal to x line so
an object initially located here when translated along y is equal to x line may actually look
like this or this which adds to the 3D viewing. So a simple translation is adding to the process
of 3D image.
Similarly, if I have a translation in Z that is another aspect of translation would actually
give me the notion of scaling and that we absorb as zooming in zooming out. This is
one of the things we often absorb. The object here looks big and the object here will look
small and this is when everything is in front of the projection plane if it goes behind
the projection plane then the object becomes smaller than its original shape. So, just
a simple addition of transformation of like translation can change the process of viewing.
Further I add rotation.
I do a rotation before I take the perspective transformation and now I am always doing perspective
transformation which is a single point that is one point. Now I do a rotation about y
axis by an angle phi. So the total transformation is basically the rotational transformation
and the projection transformation which is this multiplied by this.
And if I see the resulting matrix this is what I get. In the last column we considered
single point perspective. The only thing is I applied a transformation of rotation before
I gave the perspective transformation. So now this gives me a two point perspective
transformation. Therefore in this way I can have a two point perspective transformation
using single camera.
Similarly if I use two rotations about Y axis by an angel phi and about X axis about an
angle theta so the total transformation is the rotation about Y, rotation about X and
the projection transformation. So if I multiply these three matrices this is what I get.
Now I have all those three entries non zero which basically means that I get a three point
perspective transformation. So now using two rotations but still using a same single point
perspective transformation I can give the effect of three point perspective transformation.
This is how I can generate the various types of perspective transformation.