The current geometry of the plant branches is a cylinder with one end
smaller than the other end. The branches are scaled down to smaller branches every
time they grow. Whenever the Turtle moves in the Interpreter class, it leaves a
trail in three-dimensional space, and then we construct a cylinder around the trail as the visual
shape of the plant in the Model class.
The traditional method of modeling arbitrary surfaces such as leaves and petals
makes use of bicubic patches, which are defined by three polynomials of third
degree with respect to two parameters. But the problem is that the surfaces
defined by this method do not grow, and more importantly, because our project
needs fast animations, that there is also not enough time to calculate
complicated equations. By a simple extension to the L-system interpretation,
we build leaf geometry from the L-system rules. We interpret the symbols
inside the braces as the description of the leaf geometry. The trail of
the turtle presents the framework of the leaf, and we could use the
Model class to draw a polygon in three dimensions by mean of
the end points of the trails.
Figure 2: Turtle trails and geometry in model
The basic object is a polygon denoted by its vertices in clockwise order.
The polygons are also used to cover the surfaces of a three-dimensional
object(refer to
Figure ).