Game Development Reference
In-Depth Information
Figure 8.5. AvertexformedbyanintersectionofplaneA,B,andC.
this method is not as fast as the previously mentioned method, it is, however, less
likely to create inaccurate geometry. Its speed is less of an issue, however, as there
are ways to cache the base geometry of a brush, which is described in Section 8.3.
Asshownin Figure8.5 , every3Dintersectionmustgothroughatleastthree
planes. All the valid vertices can be found by looping through all the combinations
of three planes in our brush and calculating the intersection of those three planes.
When the resulting vertex is valid, meaning it has no infinite or NaN values, we
then check it against the remaining planes in the brush to ensure that this vertex
doesn't lie on the outside of the brush. This can be done by checking if a vertex lies
on the positive side of a plane, in which case it's outside and we reject it; otherwise,
we store the vertex, including all the planes that intersect with that vertex.
At this point, each vertex has a list of planes associated with them, and unless
a plane only goes through a single vertex, these combinations of planes should form
edges.Asshownin Figure8.6 , eachedgeisformedbyexactlytwoplanesandwill
have two vertices; one at each end. Our edges can be determined by finding two
vertices that share two intersecting planes. Because every plane will have exactly
Figure 8.6. An edge formed by plane A and B and its two vertices.
 
Search WWH ::




Custom Search