CS3500 Computer Graphics Module On Representation of Primitives
CS3500 Computer Graphics Module On Representation of Primitives
CS3500
1
Representations of Primitives
• How do we represent different curves and surfaces for
graphics?
Points
• Most fundamental entity. Other primitives ultimately use
points and their interconnections.
End of Class 27
Properties of Representations
• What do we want from representations?
• Drawing the polygon quickly/easily is most important.
• Reduced representational complexity or size.
• The following questions should be answered easily:
Which vertices define a given edge? Which edges meet
on a vertex? Which edges do 2 polygons share? Etc.
• Explicit representation is good for drawing.
Not good to answer these questions.
Planes of Polygons
• The plane normal of polygons may be needed.
• Plane equation: nTp = 0, with homogeneous vectors.
• Cross-product of 2 non-parallel sides gives 3 components
of n. Fourth obtained by substituting a point.
• For an N -sided polygons, the area of projection onto each
plane can also give the first 3 components.
• nTp is a measure of the distance from p to the plane.
• An enumeration of N points in 3D may not be planar!
Example
Different representations: size, complexity.
Representation of Curves
• Explicit: y = f (x), z = f (x).
Problems: Multiple y-values difficult, rotation changes
representation, slope of ∞ hard to represent.
• Implicit: f (x, y, z) = 0.
How do we represent segments? Tangents?
Example
G2
G1
G0
Geometry Vector
• Cubic curves have 4 unknowns. Need four constraints
from the geometry to solve for them.
Basis Matrix
m11 m12 m13 m14
m21 m22 m23 m24
• Write C = M · G = G
m31 m32 m33 m34
m41 m42 m43 m44
Blending Functions
• Q(t) = T M G = B G.
End of Class 28
Hermite Curves
• Q(t) = T · MH · GH
• k = 1 for C1 continuity.
Bézier Curves
1 0 0 0
0 0 0 1
• GH = GB = MHB · GB
−3 3 0 0
0 0 −3 3
• C1 continuity when k = 1.
Hermite Surfaces
• Q(s, t) = S · MH · GH(t) = S · MH · GH · MTH · TT
• GH(t) = [P1(t) P4(t) R1(t) R4(t)]T
• GH in turn
consists of points and tangents.
x(0, 0) x(0, 1) xt(0, 0) xt(0, 1)
x(1, 0) x(1, 1) xt(1, 0) xt(1, 1)
G Hx =
xs(0, 0) xs(0, 1) xst(0, 0) xst(0, 1)
xs(1, 0) xs(1, 1) xst(1, 0) xst(1, 1)
∂x ∂x ∂ 2x
where xt = ∂t , xs = ∂s , xst = ∂s∂t
Bézier Surfaces
• Q(s, t) = S · MB · GB(t) = S · MB · GB · MTB · TT
Surface Normals
• Partial derivatives define tangents.
∂ Q(s,t)
∂s = [3s2 2s 1 0] · M · G · MT · TT
∂ Q(s,t)
∂t = S · M · G · MT · [3t2 2t 1 0]T
End of Class 29
Solid Objects
• Most objects are solid, though we see only their outer
surface.
Volume Cells
• Rectangular volume cells or voxels are common for
representation.
Octrees
2 3
6 2 3
6 7 3 3
6 7 7
6 1
4 5 5
1 X
5
4 5
End of Class 30