Game Development Reference
In-Depth Information
(a)
(b)
Figure 8.3. (a) One brush in another brush with shared polygonal area; both touching
surfaces are pointing in the same direction. (b) One brush touching another brush with
shared polygonal area, both touching surfaces are pointing in the opposite direction.
and both need to be removed. This shared area can be thought of as being inside
both cubes.
As the CSG tree is traversed, each CSG node modifies the categorization of
the input polygons according to the specific CSG operation. Finally, at the root
node, if categorization of a polygon is inside or outside, we remove it. When it
is categorized as touching and inverted, we reverse the order of its vertices. All
the polygons that are categorized as touching and aligned do not need any further
processing.
Popular
Name
Official
Name
Logical
Operation
Description
Illustration
Addition
A
||
B
Join two
brushes
together
Union ( ￿ )
or
!(!
A
&& !
B)
Common
Intersection
(∩ )
A
&&
B
Only keep the
common area
of two brushes
or
!(!
A
|| !
B)
Subtraction Difference
(
A
&& !
B
Remove the
area of brush
B overlapping
the area of
brush A
or −)
or
!(!
\
A
||
B)
Tab l e 8.1. Overview of the most common CSG operations.
 
Search WWH ::




Custom Search