
192
Chapter 7 Terrain Level of Detail
Figure 7.5
The subdivision progression for Seumas McNally's bintree tessellation code. The root
triangle is A, with a right child B, and a left child C. C has a right child D, and a left
child E.
tri->LeftChild = AllocateBinTri ();
tri->RightChild = AllocateBinTri ();
tri->LeftChi Id->LeftNeighbor = tri->RightChi Id
tri->RightChild->RightNeighbor = tri->LeftChild
tri->LeftChild->BottomNeighbor = tri->LeftNeighbor
if tri->LeftNeighbor is valid {
if tri->LeftNeighbor->BottomNeighbor == tri {
tri->LeftNeighbor->BottomNeighbor = tri ->LeftChi I d
} else {
tri->LeftNeighbor->RightNeighbor ...