Lecture 27
Lecture 27
Lecture 27
Graphics
Lecture
REVIEW II
Taqdees A.
Siddiqi
cs602@vu.edu.p
k
CLIPPING
Restricting the effect of
graphics primitives to a
sub-region of the canvas
Protecting other portions
of the canvas
Point Clipping
xmin <= x <= xmax
Weiler-Atherton clipping
algorithm clips any polygon
against any clip polygon. The
polygons may even have
holes.
Four Cases of Polygon
Clipping Against One Edge
Translation
Rotation
Scaling
Reflection
Shearing
Now x′ = x + tx , y′ = y + ty
and z′ = z + tz can be expressed as a
single matrix equation:
P′ = P + T
x x' = tx
Where P = y P′ = T t
y ' y
z z ' t z
Homogeneous
Coordinates
x' 1 0 0 tx x
y ' 0 1 0
t y y
.
z' 0 0 1 tz z
1 0 0 0 1 1
Abbreviated as:
P’ = T (tx, ty , tz) . P
x' x t x
y ' y t
y
z' z t z
1 1
Rotation
Abbreviated as:
P’ = R (θ) . P
… Now in 3D
( Sx = Sy = Sz)
Differential Scaling
Sx 0 0 0
0 Sy 0
0
0 0 Sz 0
0 0 0 1
Scaling w.r.t. a fixed position
1. Parallel Projection
2. Perspective Projection
1. Orthographic
2. Oblique
Here are three orthographic views of an
object.
There are three axonometric
projections:
1. Isometric
2. Dimetric
3. Trimetric
1. Isometric