Graphics Reference
In-Depth Information
P
, which is the
constant-normal form
of the plane. When
n
is unit,
d
equals
d
=
n
·
the distance of the plane from the origin. If
n
is not unit,
d
is still the distance, but
now in units of the length of
n
. When not taking the absolute value,
d
is interpreted
as a signed distance.
The constant-normal form of the plane equation is also often written component-
wise as
ax
+
by
+
cz
−
d
=
0, where
n
=
(
a
,
b
,
c
) and
X
=
(
x
,
y
,
z
). In this text, the
ax
0,
as the former tends to remove a superfluous negation (for example, when computing
intersections with the plane).
When a plane is precomputed, it is often useful to have the plane normal be a
unit vector. The plane normal is made unit by dividing
n
(and
d
, if it has already
been computed) by
+
by
+
cz
−
d
=
0 form is preferred over its common alternative,
ax
+
by
+
cz
+
d
=
√
a
2
c
2
. Having a unit plane normal simplifies
most operations involving the plane. In these cases, the plane equation is said to be
normalized
. When a normalized plane equation is evaluated for a given point, the
obtained result is the signed distance of the point from the plane (negative if the
point is behind the plane, otherwise positive).
A plane is computed from three noncollinear points as follows:
n
=
+
b
2
+
struct Plane {
Vector n;
// Plane normal. Points x on the plane satisfy Dot(n,x) = d
float d;
// d = dot(n,p) for a given point p on the plane
};
// Given three noncollinear points (ordered ccw), compute plane equation
Plane ComputePlane(Point a, Point b, Point c)
{
Plane p;
p.n = Normalize(Cross(b - a, c - a));
p.d = Dot(p.n, a);
return p;
}
A plane can also be given in a
parameterized
form as
P
(
s
,
t
)
=
A
+
s
u
+
t
v
,
where
u
and
v
are two independent vectors in the plane and
A
is a point on the
plane.
When two planes are not parallel to each other, they intersect in a line. Similarly,
three planes — no two parallel to each other — intersect in a single point. The angle
between two intersecting planes is referred to as the
dihedral angle
.