You are on page 1of 10

2.

1 Three Dimensional primitives:


In a two dimensional plane, the objects that were considered are simple polygons. In three
dimensions, they are no longer restricted to lie in the same plane. Hence curves become curves in
space, and objects with interiors can become surface in space.
We face two problems when we expand our graphics system to incorporate all these
possibilities.
1) The mathematical definitions of these objects can become complex.
2) We are interested in only these objects that lead to efficient implementations in graphics
system.
The following are three features characterize 3D objects that fit well with existing hardware and
software:
1) The objects are described by their surfaces and can be thought of as being hollow.
2) The objects can be specified through a set of vertices in three dimensions.
3) The objects either are composed of or can be approximated by flat, convex polygons.
The first condition implies that we need only 2D primitives to model 3D objects because surface is a
two rather than a 3D entity. The second condition says that, if an object is defined by vertices, we
can use pipeline architecture. The third condition is an extension of 2D polygons..

2.2 Co ordinate systems and Frames.


So far, we have studied vectors and points as abstract objects, without representing them in any
reference system. In 3D vector space a vector w is represented uniquely in terms of any linearly
independent vectors v1, v2 and v3 as

w= 1 v1 + 2 v2 + 3 v3 ----------------------> (1)
Where 1, 2, 3 are scalars components of w w.r.t the basics v1, v2, v3. these relationships are
shown in figure 2.1 v2

v1
v3
figure 2.1

1
We can write the representation of w w.r.t this basis as the column matrix.

α1
a = α2
α3
Where a is a representation in a particular basis. We can re write equation (1) as
v1
w = a T v2 = aTv
v3

v1
Where v = v2
v3

The basis vectors v1, v2 and v3 defining a coordinate system. However, for dealing with problems
using points, vectors and scalars need more general method. The Figure 2.2 explains one of the
problems.

(a) (b)

Figure 2.2 (a) vector emerging from common point (b) Vector moved

2
The three vectors fo rm a coordinate system shown in Figure 2.2(a) we could use these vectors as a
basis to represent any vector in 3D, however in Figure 2.2(b), vectors have same direction and
magnitude, but lack a position attribute. Hence Figure 2.2(b) is equivalent to Figure 2.2(a).

Because an affine space contains points, once we fix a particular reference point called origin, in
such a space we can represent all points unambiguously. Figure 4.22(a) makes sense in the affine
space where both points & vectors have representations. This representation requires both the
reference point and the basis vectors. The origin and the basis vectors determine a frame.

Within a given frame, every vector can be written uniquely as


w= 1 v1 + 2 v2 + 3v3 = aT v.
and every point can be written uniquely as
P = Po + 1 v1 + 2v2 + 3v3

= Po + bT v.
Thus, the representation of a particular vector in a frame requires three scalars, the representation of
a point requires three scalars and the knowledge of where the origin is located.
2.2.1 Representations and N-Tuples
Suppose that vectors e1, e2 & e3 form a basis, The representation of any vector v is given by the
component 1, 2 and 3 of a vector a, where
v= 1e1 + 2e2 + 3e3.

This basis vectors must themselves have representations that we can denote e1, e2 & e3 by
e1 = (1,0,0) T
e2 = (0,1,0) T
e3 = (0,0,1) T

Rather than thinking in terms of abstract vector, we can work with 3 tuples and we can write the
representation of any vector v as a column matrix ‘a’ or the 3 tuple ( 1, 2. 3) where a = 1e1 + 2e2 +
3
3e3. The basis 3 tuples e1, e2, and e3 are vectors in the familiar Euclidian space R

2.2.2 Change of coordinate systems.

3
The representation of the vector changes when basis vector changes. Let’s consider changing
representations for vectors first, suppose that {v1, v2, v3} and {u1, u2, u3} are two bases. Each basis
vectors in the second set can be represented in terms of the first set (and vice versa). Hence, there
exists nine scalar components { ij}, such that
u1 = 11 v1+ 12 v2+ 13 v3
u2 = 21 v1 + 22 v2+ 23 v3

u3 = 31 v1+ 32 v2 + 33 v3

γ 11 γ 12 γ 13
The 3*3 matrix M = γ 21 γ 22 γ 23 is defined by these scalars
γ 31 γ 32 γ 33

and
u1 v1
u 2 = M v2 or u =M v .
u3 v3

The M contains information to go from a representation of a vector in one basis to its representation
in the second basis. The inverse of M gives the matrix representation of the change from {u1, u2, u3}
to {v1, v2, v3}.
Consider a vector w that has the representation { 1, 2, 3} w.r.t (v1, v2, v3} i.e.
w= 1 v1 + 2 v2 + 3 v3

we can write it as w = aT v.
α1 v1
a = α2 and v = v2
α3 v3
assume that ‘b’ is the representation of w w.r.t {u1, u2,u3} i.e.
w= 1 u1 + 2 u2+ 3 u3 or
u1
w = bT u2 = bT u
u3

4
β1
Where b = β2
β3
Then using our representation of second basis in terms of the first basis, we find tat
u1 v1
w = b u2 = b M v2
T T

u3 v3
v1
= aT v2
v3

Thus a = MT b

The matrix T = (MT)-1


Takes us from a to b through simple matrix equation b = T a.
So, rather than working with original vectors, we can work instead with their representations, which
are 3 tuples or elements of R3.There changes in basis leave the origin unchanged. We can use them
to represent rotation & scaling, but point cannot be represented in this way, it requires homogeneous
coordination system.

2.2.3 Example change of representation.

Suppose that we have a vector w whose representation in some basis is

1
a= 2
3

We can denote the three basis vectors as v1, v2 and v3, Hence, w = v1 + v2 + v3

Now, suppose that we want to make a new basis from three vectors v1, v2 and v3 where

u1 = v1
u2 = v1 + v2
u3 = v1 + v2 + v3

5
1 0 0
The matrix M is 1 1 0
1 1 1

The matrix that converts a representation in v1, v2 & v3 to one in which the basis vectors are u1, u2
and u3 is

T = (MT)-1
−1
1 1 1 1 −1 0
= 0 1 1 = 0 1 1
0 0 1 0 0 1

In the new system, the representation of w is b=Ta


−1
a = −1
3
That is w = - u1 - u2 + 3u3

2.2.4 Homogeneous Coordinates

Suppose that we start with the frame defined by the point Po and vectors v1, v2 & v3, a point
‘P’ located at (x, y, z) with the column matrix

x
P= y
z
where x, y and z are the components of the basis vectors for this point, so P = Po + x v1+ y v2 + z v3,
if we represent the point in this way, then its representation is of the same form as the vector
w = x v1 + y v2 + z v3

6
Homogeneous Coordinates avoid this difficulty by using four dimensional representation for both
points and vectors in 3D. In the frame specified by (v1, v2, v3, Po). any point P can be written

uniquely as

P= 1 v1 + 2 v2 + 3v3+ Po.
If we define the multiplication of a point by the scalars 0 and 1 as
0.P=0
1.P=P
Then we can express this relation formally, using a matrix product as

v1
v2
P = [α 1 α 2 α 3 1]
v3
p0
Homogeneous Coordinate representation of the point P in the frame determined by v1, v2, v3 and Po.
Equivalently, we can say that P is represented by the column matrix
α1
α
P= 2
α3
1
in the same frame any vector w can be written as
w = δ 1v1 + δ 2 v2 + δ 3 v3

v1
v2
= [δ 1 δ 2δ δ 3 0]
T

v3
p0
Thus w can be represented by the column matrix

7
δ1
δ
w= 2
δ3
0
Consider, for example, a change of frames - a problem that caused difficulties when we used 3D
representations If (v1, v2, v3, Po) and (u1, u2, u3, Qo) are two frames then we can express the basis
vectors and reference point of the second frame in terms of the first as

u1 = 11 v1+ v2+
12 13 v3
u 2= 21 v1+ 22 v2+ 23 v3
u 3= 31 v1+ 32 v2+ 33 v3
u 4= 41 v1+ 42 v2+ 43 v3+ Po

the above equations can be written as

u1 v1
u2 v2
=M where M is the 4 * 4 matrix
u3 v3
Q0 p0

γ 11 γ 12 γ 13 0
γ γ 22 γ 23 0
M = 21 M is called matrix representation of the change of frames.
γ 31 γ 32 γ 33 0
γ 41 γ 42 γ 43 1

We can also use M to compute the changes in representation. Suppose a and b the homogeneous
coordinate representation either of two points or two vectors in the two frames then

u1 v1 v1
u2 v2 v2
bT = bT M = aT
u3 v3 v3
Q0 p0 p0

8
a = MT b

α 11 α 12 α 13 α 14
α α 22 α 23 α 24
where M = 21
α 31 α 32 α 33 α 34
0 0 0 1

All affine transformations can be represented as matrix multiplications in homogeneous coordinates.

2.2.5 Example change in frames

Consider again the example discussed previously in section 2.2.3. If we again start with the basis
vectors v1, v2 and v3 and convert to a basis determined by the same u1, u2 & u3, then the three
equations are
u1 = v1
u2 = v1+v2
u3 = v1+v2+v3

The reference point does not change, so we add the equation Qo = Po

1 0 0 0
1 1 0 0
M=
1 1 1 0
0 0 0 1

Thus, the matrix in which we are interested are transpose of above & their inverse.
Suppose that in addition to changing the basis vectors we also want to move the reference point to
the point that has the representation (1, 2, 3, 1) in the original system. The displacement vector v =
v1+ 2v2 + 3v3 moves Po to Qo. The fourth component identifies this entity as a point. So

Qo = Po + v1+ 2v2 + 3v3 and the matrix MT becomes

9
1 1 1 1 1 − 1 0 1
0 1 1 2 0 1 − 1 1
its inverse is T = (MT)-1 = 0 0 1 3
0 0 1 3
0 0 0 1 0 0 0 1

Note that a takes the point (1, 2, 3) in the original frame, whose representation is

1 0
2 0
P= to P =
|

3 0
1 1

The origin in new system


However, the vector (1, 2, 3) which is represented as
1 −1
2 −1
a= in the original system is transformed to b=
3 3
0 0

10

You might also like