Game Development Reference
In-Depth Information
Converting a normal and a point on the line to normal and distance
form:
distance = n q .
(This assumes that n is a unit vector.)
Finally, to convert perpendicular bisector form to implicit form, we use
a = q y − r y ,
b = r x − q x ,
d = q + r
2
= q + r
2
a b
q y − r y r x − q x
= (q x + r x )(q y
− r y ) + (q y + r y )(r x
− q x )
2
= (q x q y
− q x r y + r x q y
− r x r y ) + (q y r x
− q y q x + r y r x
− r y q x )
2
= r x q y
− q x r y .
9.3
Spheres and Circles
A sphere is a 3D object defined as the set of all points that are a fixed
distance from a given point. The distance from the center of the sphere to
a point is known as the radius of the sphere. The straightforward repre-
sentation of a sphere is to describe its center c and radius r.
Spheres appear often in computational geometry and graphics because
of their simplicity. A bounding sphere is often used for trivial rejection
because the equations for intersection with a sphere are simple. Also im-
portant is that rotating a sphere does not change its extents. Thus, when
a bounding sphere is used for trivial rejection, if the center of the sphere is
the origin of the object, then the orientation of the object can be ignored.
A bounding box (see Section 9.4) does not have this property.
The implicit form of a sphere comes directly from its definition: the set
of all points that are a given distance from the center. The implicit form
of a sphere with center c and radius r is
Implicit definition of a
sphere using vector
notation
p c = r,
(9.7)
where p is any point on the surface of the sphere. For a point p inside the
sphere to satisfy the equation, we must change the “=” to a “≤”. Since
Equation (9.7) uses vector notation, it also works in 2D, as the implicit
definition of a circle. Another more common form is to expand the vector
notation and square both sides:
Search WWH ::




Custom Search