Professional Documents
Culture Documents
U N I T
Geometric
Objects
- 4
and Transformations
scalars
points and
vectors
These basic entities can be defined in at least three different ways: from a
geometric perspective
mathematical perspective or
programming (computer-science) perspective
To understand the difference between the mathematical definition of each type and the particular
implementation of that type, the study of underlying mathematics is required.
4.1.1 The Geometric View
POINT
The only attribute that a point possesses is that point's location; a mathematical point does
not even have a size.
SCALARS
Although scalars lack geometric properties, scalars are used as units of measurement.
VECTORS
The directed line segments (vectors) connecting points are called vectors. The term vector is
used for any quantity with direction and magnitude.
In the below figure, three vectors are identical because they have the same direction
(orientation) and magnitude (length). They are identical, although their positions differ.
The length and the direction of a vector can be changed by real numbers.
Priyanka H V
Page 1
Computer Graphics
Points and vectors are two distinct geometric types. Two operation takes place between
them:
point-vector addition
point-point subtraction
Point-Vector addition:
Figure shows the operation taking place between points and directed line segments (vectors).
A directed line segment is moved from one point to another. This operation is called as pointvector addition, and it produces a new point.
Point-Point subtraction
Any two points dene a directed line segment or vector from one point to the second.This
operation is called as point-point subtraction.
Page 2
Computer Graphics
Scalars can be combined with the rules (operations) called addition and multiplication.
A scalar and a vector can be combined with in a vector space, to form new vector through
scalar-vector multiplication.
Examples of mathematical vector spaces include n-tuples of real numbers, the solution of
homogeneous linear differential equations, and the geometric operations on vectors.
Euclidean space
Affine Space
An affine space is an extension of the vector space that includes an additional type of
object: the point and rules to perform operations on them.
Operation between points:
Examples of affine spaces include the geometric operations on points and vectors and the
solution of linear inhomogeneous ordinary differential equations.
The computer-Science view points, scalars and vectors as abstract data types (ADTs).
An ADT is a set of operations on data; the operations are defined independently of how
the data are represented internally or of how the operations are implemented.
From a computational point of view, the geometric objects can be declared through code
such as
vector u, v;
point
Priyanka H V
Page 3
p, q;
Computer Graphics
scalar a, b;
regardless of the internal representation or implementation of the objects on a particular
system.
4.1.5 Geometric ADTs
Points, Scalars and Vectors with their geometric, Mathematical and Computer Science Views
can be used to perform geometrical operations and to form new objects.
Let P, Q, R, . . .define points;
Let , , , . . . denote scalars; and
Let u, v, w,. . . denote vectors.
For vectors and points, this notation refers to the abstract objects and this notation does not
refer to the representations of these objects in a particular reference system.
Vector-Scalar Multiplication:
a vector v denoted by v = P - Q.
Second, given any point Q and vector v, there is a unique point,
P.
This statement can be expressed as: Given a point Q and a vector
v, there is a point P such that P = v + Q. Thus, P is formed by a
point-vector addition operation.
Figure shows a visual interpretation of this operation.
Vector-vector addition:
The head-to-tail rule gives way of visualizing vector-vector addition.
The sum u + v is obtained as shown in below figure by drawing the sum vector as connecting
the tail of u to the head of v.
Priyanka H V
Page 4
as shown below:
Computer Graphics
4.1.6 Lines
The sum of a point and a vector (or the subtraction of two points) leads to the notion of a line
in an affine space.
Given the rules for combining points, vectors, and scalars in an affine space, P() is a point
for any value of .
If is restricted to non-negative values, ray emanating from Po and going in the direction of
d is obtained.
In an affine space, the addition of two arbitrary points and the multiplication of a point by a
scalar are not defined. However, there is an operation called affine addition that has certain
elements of these latter two operations.
describes all points on the line from Q in the direction of v, as shown below:
This operation looks like the addition of two points and leads
to the equivalent form
P =l R +2Q,
where l + 2 = 1.
4.1.8 Convexity
A convex object is one for which any point lying on the line segment connecting any two
points in the object is also in the object.
For 0 1, the affine sum defines the line segment connecting R and Q, as shown in figure
below.
Priyanka H V
Page 5
Computer Graphics
Convex Hull : The set of points formed by the affine sum of n points, under the additional
restriction i 0, i = 1,2,3n, is called the convex hull of the set of points.
Geometric concepts related to the orientation (direction) between two vectors are in the terms
of Dot product and Cross product.
DOT PRODUCT:
Given three linearly independent vectors in a three-dimensional space, dot product can be
used to construct three vectors, each of which is orthogonal to the other two.
CROSS PRODUCT:
Cross product of two non-parallel vectors, say u & v, gives a third vector, say n, that is
orthogonal to both u and v. i.e., n = u x v
The magnitude of the cross product gives the magnitude of the sine of the angle between u
and v
A plane in an affine space can be defined as a direct extension of the parametric line.
From simple geometry, the three points, not in a line, determine a unique plane.
Priyanka H V
Page 6
Computer Graphics
The line segment that joins P and Q is the set of points of the form
S() = P + (1 - ) Q, 0 1.
T() = S + (1 - ) R, 0 1
Such points are determined by both and , and form the plane determined by P, Q, and R.
Combining the preceding two equations, the equation of a plane is:
T(, ) = [ P + (1 - ) Q] + (1 - ) R
By rearranging,
T(, ) = [ P + (1 - ) Q] + (1 - ) R
T(, ) = P + (1 - ) (Q-P)] + (1 - ) (R-P)
For 0 , 1, all the points T(, ) lie in the triangle formed by P, Q, and R.
The vector n is perpendicular, or orthogonal, to the plane; it is called the normal to the
plane.
The forms P() for the line and T(, ) for the plane, are known as parametric forms,
because they give the value of a point in space for each value of the parameters and .
It retains even the objects available in 2-D world but they are no longer restricted to lie in the
same plane.
E.g.
1. 2-D curves become
2. Objects with interiors can
3.In addition, 3-D provides objects with volumes, curves in space become surfaces in space
such as parallelepipeds and ellipsoids
Priyanka H V
Page 7
Computer Graphics
Three features characterize three-dimensional objects that fit well with existing graphics
hardware and software:
The objects are described by their surfaces and can be thought of as being hollow:
Reason for this condition: This condition implies that only 2-D primitives are needed to model
3-D objects, because a surface is a two- rather than a 3-D entity. This is because the modern
graphics systems render triangular or other flat, polygons. High-end systems can render over 5
million small, flat polygons per second; boards in personal computers have rendering speeds of
over 1 million polygons per second.
Reason for this condition: If an object is defined by vertices, pipeline architecture can be used
to process these vertices at high rates, and hardware can be used to generate the images of the
objects only during rasterization.
The objects either are composed of or can be approximated by flat convex polygons.
Reason for this condition: Most graphics systems are optimized for the processing of points and
polygons. In 3-Ds, a polygon can be defined by an ordered list of vertices. However, if there are
more than three vertices, they do not have to be in the same plane; if they are not, there is no
simple way to define the interior of the object.
Triangular polygons are always flat, either the modeling system is designed always to produce
triangles, or the graphics system provides a method to divide, or tessellate, an arbitrary polygon
into triangular polygons.
If the same argument is applied to a curved object, such as to a sphere, small flat polygons can be
approximated to form the sphere. Hence, if the modeling system provides curved objects, it can
be assumed that a polygonal approximation is used for implementation.
Although this approach is an excellent one for modeling, rendering CSG models is
more difficult than is rendering surface-based polygonal models.
Priyanka H V
Page 8
Computer Graphics
The scalars 1, 2, and 3 are the components of w with respect to the basis v1, v2, and v3.
These relationships are shown in the figure.
However, for dealing with problems using points, vectors, and scalars, a more general
method is needed.
These three basis vectors can be used as a basis to represent any vector in three dimensions.
Vectors, however, have direction and magnitude, but lack a position attribute.
Figure (b) is equivalent, because the basis vectors, are moved, leaving their magnitudes and
directions unchanged.
To represent points:
An affine space contains points, in such a space, once a particular reference point say -the
origin- is fixed, all other points can be represented unambiguously.
The usual convention for drawing coordinate axes is emerging from the origin, as shown in
above figure (a).
Frame is the representation which requires both the reference point and the basis vectors.
This extension fixes the origin of the vector coordinate system at some point Po. Within a
given frame, every vector can be written uniquely as
w =lv1 + 2v2 + 3v3.
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.
4.3.2 Changes of Coordinate Systems
The representation of a vector changes when the basis vectors are changed.
Priyanka H V
Page 9
Computer Graphics
Suppose that {v1, v2, v3}and {u1, u2, u3} are two bases.
Each basis vector in the second set can be represented in terms of the first basis (and vice
versa). Hence, there exist nine scalar components, {ij }, such that
The 3 x 3 matrix
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} with respect to {v1, v2, v3}
w =lv1 + 2v2 + 3v3
Equivalently, w = aT
where a =
Assume that b is the representation of w with respect to {u1, u2, u3} i.e.
w =lu1 + 2u2 + 3u3
or
w = bT
where b =
Then, using the representation of the second basis in terms of the first,
Thus, a = MTb.
Priyanka H V
Page 10
Computer Graphics
This result indicates that abstract vectors can be worked with column matrices of scalars - the
vectors' representations.
A point P located at (x, y, z) can be represented using a 3-D frame determined by Po, v1, v2,
and v3, with the column matrix:
where x, y, and z are the components of the basis vectors for this point, so that,
P = Po + xv1 + yv2 + zv3
If the point is represented this way, then its representation is of the same form as the vector
w =lv1 + 2v2 + 3v3
The vector from the point (1,1,1) to (2,3,4) is the same as the vector from (0,0,0) to (1,2,3),
because they have the same magnitude and direction, but the first vector would not be
associated with point (1,2,3) unless one end of it is fixed to (0,0,0). Here points and vectors
In the frame specified by ( v1, v2, v3, Po), any point P can be written uniquely as
P = lv1 + 2v2 + 3v3 + Po
Priyanka H V
Page 11
Computer Graphics
The 4-D row matrix on the right side of the equation is the homogeneous-coordinate
representation of the point P in the frame determined by (v1, v2, v3, Po).
w=
There are numerous ways to interpret this formulation geometrically. The operations on
points and vectors can be carried out using their homogeneous-coordinate representations
and ordinary matrix algebra.
Consider a change of frames - a problem that caused difficulties when in 3-D representations.
If (v1, v2, v3, Po) and (u1, u2, u3, Q0) are two frames, then the basis vectors and reference point
of the second frame can be expressed in terms of the first as:
Suppose that a and b are the homogeneous-coordinate representations either of two points or
of two vectors in the two frames. Then,
Hence a = MTb
Advantages of using homogeneous coordinates:
Priyanka H V
Page 12
Computer Graphics
Assume that a new basis is to be made from the three vectors v1, v2, and v3.
u1 = v1
u2 = v1+v2
u3 = v1+v2+v3
Thus, the matrices of interest are the following matrix, its transpose and inverse:
Suppose that in addition to changing the basis vectors, it is needed to move the reference
point to the point that has the representation (1,2,3,1 ) in the original system.
The fourth component identifies this entity as a point. Thus, the three equations are added
from the previous example, the equation
Q0 =P0 + v1 + 2v2 + 3v3
Matrix MT becomes
This pair of matrices allows moving back and forth between representations in the two
frames.
Priyanka H V
Page 13
Computer Graphics
to P' =
the
, a transformation that is consistent with the results from the example of change in
coordinate systems, and that also demonstrates the importance of distinguishing between
points and vectors.
Priyanka H V
Page 14