Title: 2D Geometry
12-D Geometry
2(No Transcript)
3- Homogeneous Coordinates
- The purpose of using homogeneous coordinates is
to capture the concept of infinity as we cant
represent the infinity with the conventional
Cartesian system. - We use two numbers a and w to represent a value
v, va/w. If w is not zero, the value is exactly
a/w. Otherwise, we identify the infinite value
with (a,0). Therefore, the concept of infinity
can be represented with a number pair like (a,
w). - Given a polynomial of degree n, after
introducing w, all terms are of degree n.
Consequently, these polynomials are called
homogeneous polynomials and the coordinates
(x,y,w) the homogeneous coordinates.
4For example Suppose we have a line Ax By C
0. Replacing x and y with x/w and y/w yields
A(x/w) B(y/w) C 0. Multiplying by w
changes it to Ax By Cw 0. Similarly, let
the given equation be a second degree polynomial
Ax2 2Bxy Cy2 2Dx 2Ey F 0. After
replacing x and y with x/w and y/w and
multiplying the result with w2, we have Ax2
2Bxy Cy2 2Dxw 2Eyw Fw2 0
5- Converting Homogeneous to Cartesian
- Given a point (x,y,w) in homogeneous
coordinates, its corresponding point in the
xy-plane is (x/w,y/w). - e.g. a point (3,4,5) in homogeneous
coordinates converts to point (3/5,4/5)(0.6,0.8)
in the xy-plane. - Similarly, a point (x,y,z,w) in homogeneous
coordinates converts to a point (x/w,y/w,z/w) in
space. - Conversely, the homogeneous coordinates of a
point (x,y) in the xy-plane is simply (x,y,1). It
is not unique. The homogeneous coordinates of a
point (x,y) in the xy-plane is (xw, yw, w) for
any non-zero w. - Converting from a homogeneous coordinates to a
conventional one is unique but, converting a
conventional coordinates to a homogeneous one is
not.
6- Transformation
- It is the simulation of the manipulation of
objects in space by a graphics system is known as
- Or
- It is altering the coordinate description of an
object by changing orientation, size and shape of
it. - Why are they important to graphics?
- moving objects on screen / in space
- mapping from model space to world space to
camera space to screen space - specifying parent/child relationships
7 There are 2 types of transformation Geometric
Object is transformed relative to stationary
coordinates. Coordinate Object is stationary
and coordinate system is transformed.
8Geometric transformation The basic geometric
transformations are Translation, Rotation and
Scaling
Translation A translation is applied to an
object by repositioning it along a straight line
path from one coordinate location to another. We
can translate a 2-D point by adding translation
distances tx and ty to the original coordinate
position (x,y) to move the point to new position
(x,y) i.e. x x tx y y ty
9(No Transcript)
10Rotation Rotation is applied to an object by
repositioning it along a circular path in the xy
plane. We specify a rotation angle and the
position of the rotation point (called pivot
point) about which the object is to be rotated.
ve values of angle define counterclockwise
rotations -ve values of angle define clockwise
rotation.
11Using trigonometric identities, we can represent
tranformed acoordinate as follow X rcos(T F)
r cosTcos F r sinTsinF Yrsin(T F) r
cosFsinT r cosTsinF Also X rcosF and
YrsinF Therefore X xcosT ysinT Y xsinT
ycosT
12- Rotation of a point about an arbitrary pivot
position is given as - Xxr (x-xr)cosT ( y-yr)sinT
- Yyr (x-xr)sinT (y-yr)cosT
- Rotation is a rigid body transformation
13Scaling A scaling transformation alter the size
of an object
The operation can be carried out by multiplying
coordinate values by scaling factor.
X x.sx and Y y.sy
X sx 0 x Y
0 sy y
14Uniform scaling when both sx and sy have same
value Differential scaling when both sx and sy
have different values.