Nima Kalantari
CSCE 441 - Computer Graphics
Culling, Clipping, and Viewport
Some slides from Scott Schaefer and Pradeep Sen
So far
Normalized Device Coordinates (NDC)
Outline
View Volume Culling
Normalized Device Coordinates (NDC)
View Volume Culling
Normalized Device Coordinates (NDC)
Thousands of
Triangles
View Volume Culling
Normalized Device Coordinates (NDC)
View Volume Culling
Normalized Device Coordinates (NDC)
r
c
z
Z = -1
n
p
outside frustum
View Volume Culling
View Volume Culling
Normalized Device Coordinates (NDC)
Outline
Clipping
Triangle Clipping Algorithm
Clipping Space
Clipping
z
x
y
z
near
far
far (+1)
near (-1)
Camera Coordinate
NDC
Clipping
x
y
z
near
far
far (+1)
near (-1)
Camera Coordinate
NDC
Clipping
x
y
z
near
far
far (+1)
near (-1)
Camera Coordinate
NDC
Clipping
x
y
z
near
far
far (+1)
near (-1)
Camera Coordinate
NDC
Clipping
Clipping Equation
Triangle Clipping Algorithm
Triangle Clipping Algorithm
Triangle Clipping Algorithm
Triangle Clipping Algorithm
Triangle Clipping Algorithm
Four cases for each plane
Summary
Outline
Backface Culling
Backface Culling
Backface Culling
Backface Culling
view direction
Backface Culling
view direction
, draw triangle
Backface Culling
view direction
, cull triangle
Outline
Screen
Viewport
Coordinate spaces
Modelview matrix
Projection matrix
Clipping
Homogenize
Viewport Transform
Rasterization
screen-space coordinates
normalized device coordinates (NDC)
object space coordinates
eye space coordinates
clip-space coordinates
coordinates of the vertices of the objects
eye at origin, facing –z, +x is right, +y is up
vertices are now:
0 < x < screen width
0 < y < screen height
vertices are now (xc, yc, zc, wc)
all vertices are now from -1 to 1