Game Development Reference
In-Depth Information
Chapter 9
Geometric Primitives
Triangle man, triangle man.
Triangle man hates particle man.
They have a fight, triangle wins.
Triangle man.
Particle Man (1990) by They Might Be Giants
This chapter is about geometric primitives in general and in specific.
Section 9.1 discusses some general principles related to representing
geometric primitives.
Sections 9.2 -9.7 cover a number of specific important geometric prim-
itives, including methods for representing those primitives and some
classic properties and operations. Along the way, we'll present a few
C++ snippets.
9.1
Representation Techniques
Let's begin with a brief overview of the major strategies for describing
geometric shapes. For any given primitive, one or more of these techniques
may be applicable, and different techniques are useful in different situations.
We can describe an object in implicit form by defining a Boolean func-
tion f(x,y,z) that is true for all points of the primitive and false for all
other points. For example, the equation
Unit sphere in implicit
form
x 2 + y 2 + z 2 = 1
is true for all points on the surface of a unit sphere centered at the origin.
The conic sections are classic examples of implicit representations of geo-
metric shapes that you may already know. A conic section is a 2D shape
formed by the intersection of a cone with a plane. The conic sections are
295
 
Search WWH ::




Custom Search