Plane

From DmWiki

A plane is a flat surface that extends to infinity in all directions. Mathematically, a plane can be defined by its normal vector n and a single point p on the plane's surface. Then the plane is all possible points x such that

\mathbf{n} \cdot \mathbf{x} = \mathbf{n} \cdot \mathbf{p}

An alternative form of the plane equation is

\mathbf{n} \cdot \mathbf{x} + D = 0,

where D = -n · p. The second form of the plane equation allows you to easily determine which side of the plane any point x lies on: you simply calculate n · x - D. If this number is > 0, then x is on the side of the plane to which the normal points (called the positive half-space); if it is < 0, then x is on the other side of the plane (the negative half-space). If it is exactly 0, x lies exactly on the plane.

Planes are useful in 3D geometry because triangles are sections of planes. You can determine whether a triangle is facing a particular point (such as the camera) or facing away from it by testing which side of the triangle's plane the camera lies on. Planes are also useful in CSG. In CSG, a plane is considered to be a solid volume, where the "outside" of the plane is the positive half-space, and the "inside" is the negative half-space, as well as the plane itself. Thus, shapes like boxes may be described by the CSG intersection of several planes.


DevMaster navigation