|
|
As this
web page will tell you, "Many living things grow in such a way as to produce fractal
patterns. Examples include the passageways in the lungs or the branches of a tree. In
these cases the self-similarity on different scales arises because growth involves
repetition of the same simple process (e.g. branching). These simple, repetitive
processes can often be neatly summarized as sets of simple rules.
My program accepts a formal grammar in a file which it is passed as a command-line parameter. This file is of the following format: 8 2 // ITERATIONS RULES *X // Axiom X [R*Y][U*Y] // Rule 1 Y [D*X][L*X] // Rule 2, etc. The program then modifies the initial string according to the grammar given with the number of iterations specified. It follows the resulting instruction string to generate a 3-dimensional image in a window, which can then be viewed from any angle and location using the following keys:
View the code for this project here.
|