4. Turtle graphics

This is a vector method that uses a cursor over a Cartesian plane, the cursor has an (x, y) position and a current angle θ. There is a step size r. The next position of the cursor is given by (x<sup>0</sup> , y0 ) where x<sup>0</sup> = r \* cos θ and y<sup>0</sup> = r \* sin θ. The cursor draws a line between the current and the next position. The next position then becomes the current position. For this implementation, the width and length of the line remain constant.

The needed parameters are the initial position (x<sup>0</sup> , y 0 ), initial angle θ<sup>0</sup> , a change in angle β which will be added or subtracted to the current angle, the step size r which represents the line length, and a number i of iterations which controls how many times the L-system rewriting will be performed.

The symbols used for this implementation, and their respective graphic interpretation, are presented in Table 1.


Table 1.

L-system symbols and their turtle graphic interpretation.


Resulting words after several iterations and their graphic interpretation. For example, let us assume the following L-system:

The results after four iterations are shown in Table 2. It can be observed that the

The contribution of this work within the area of procedural terrain generation is to provide a new method that generates river deltas. Likewise, this is a new adaptation of the L-systems. In this section rules and guidelines are provided to adapt the grammar and the graphic interpretation to achieve the generation of river delta

L-systems are a form of chaotic systems [15]; in practice, this means that a small

• The symbols "[" and "]" are mandatory for creating branching structures in

• For controlling growth there are rules and symbols that do not translate into a line in the interpretation; they are used to slow down the growth of the shape.

The more rules and shorter they are, they slower the growth will be.

• Using the axiom within the rules augments the self-similarity of the resulting shapes, but if used too many times, the shape gets cluttered within a few iterations.

• Rivers are sinuous, and using the symbols "+" and "�" between draw-line symbols achieves this; they should be used in pairs, if not, the shape becomes

• The angle β should be lower than 45 degrees and greater than 15 degrees to

The results are different systems which are summarized in Table 3. They are numbered in the first column; the second column contains the model consisting of the axiom and the production rules; and the following columns contain the parameters for each system. For this chapter, the implementation was done using Python 3 and the TK module, which is the standard graphic user interface for Python.

According to the classification presented in [6], systems 1, 2, 3, and 4 (which are shown in Figure 2) generate deltas that are tide-dominated. These present many distributaries that become entangled and cover a wide area; an example is the Fly River presented in part (b) of Figure 1. These systems generate skeletons that

plants; this holds true for branching rivers skeletons.

There are other guidelines specific for river deltas:

generate natural-looking skeletons.

Images of the results are presented after Table 3.

change in the initial conditions, the axiom or the rules, will have an important impact on the results. These changes are hard to predict and control. For this reason, the experimentations to obtain different systems that produced branching rivers where performed in an empirical way; nevertheless, there are certain observations

symbols "+," "�," "[," and "]" do not change because they do not have rules.

Production rules: X ! �[XF] + [FX]; F ! +FFX

An Approach for River Delta Generation Using L-Systems

DOI: http://dx.doi.org/10.5772/intechopen.90099

5. Implementation for generating river deltas

Axiom: ω = X

skeletons.

that were taken from [7]:

spiral-like.

127

6. Results and discussion

An Approach for River Delta Generation Using L-Systems DOI: http://dx.doi.org/10.5772/intechopen.90099

For example, let us assume the following L-system: Axiom: ω = X

Production rules: X ! �[XF] + [FX]; F ! +FFX

The results after four iterations are shown in Table 2. It can be observed that the symbols "+," "�," "[," and "]" do not change because they do not have rules.
