Putting It All Together

That's it for BSP trees. As a final demo, I created the BSPMapTest that puts everything together: drawing polygons from the BSP tree, drawing 3D object polygons, and loading maps from a file. Check out the screenshots in Figures 10.20 and 10.21.

Screenshot Screenshot of BSPMapTest.

Java graphics 10fig20.gif


Screenshot Screenshot of BSPMapTest.

Java graphics 10fig21.gif


This demo isn't perfect. The major problem with this demo is there is no collision handling: you can walk right through walls. Likewise, you can't walk up stairs yet, and you just stay at the same height the entire time. We'll fix this in the next chapter, "Collision Detection."

Screenshot


   
Comments