Modeling trees
Generating realistic gaming environments is one of the greatest challenges facing modern gaming. The addition of natural looking foliage can go a long way towards transforming a scene from a sterile, virtual-looking environment, into a lush, natural-looking one. Being able to do it programmatically can mean the difference between a minute's or month's worth of work for game artists.
In this example, we'll be exploring one of the ways that trees and smaller plants can be generated, and hopefully provide a starting point for you to explore some of the many variations on the technique to provide your own unique looking flora.
Getting ready
This example relies upon the GeometricBuffer
classes described in the Modeling triangles recipe within this chapter. It can be substituted with any other mesh building process of your choice though.
How to do it...
To create a disc programmatically:
1. Create a new
TreeLimb
class to hold the logic surrounding the creation of an individual tree...