Create a program that produces growing 2D plant models based on L-system growth techniques. L-sytems model plants using a grammar to simulate plant growth. Successive application of the production rules create a string which can be translated into geometry for display.
Proj3 -g 3 -a 25.7 plant1.txt > plant1.nffshould generate a plant 3 generations old using the grammar from plant1.txt and a rotation angle of 25.7 degrees, with the generated NFF redirected to
plant1.nff
.
The arguments may come in any order, except the grammar file which will always be last. Plant, generation, and
angle arguments are optional; choose appropriate defaults if
none are given.
The L-system rules will be contained in a text file. The first line will be the start symbol, with each subsequent line containing a rule for a particular symbol. For example:
X X=F-[[X]+X]+F[+FX]-X F=FF
Consider the start symbol to be generation 0. An example of a plant created by this system:
More information about L-systems can be found here.
We are providing a viewer that takes an NFF file as input and displays the scene using OpenGL, allowing the user to interact by rotating the model using the mouse, or the w, a, s, and d keys to rotate up, left, down, and right, respectively. Source code for the viewer is provided at:
/afs/umbc.edu/users/r/h/rheingan/pub/435/Proj3
The viewer makes use of the OpenGL Utility Toolkit (GLUT), which is available on any Mac OS X machine as well as the UMBC Linux machines, using the provided Makefile. GLUT is a utility toolkit that is designed to make it easier to use OpenGL with a window manager. It provides functions for handling windowing events (such as mouse clicks, key presses, etc).
You are encouraged to work locally on one of the OIT lab machines (just reboot one of the Windows machines into Linux, or use one of the Macs). If you want to develop locally on Windows, you will need to install freeglut yourself.
Submit your assignment as 'Proj3' using cvs. Include your source code and makefile. Also include a readme file with a description what hardware/software environment you used to develop your project, and a description of any help you received (or a statement that no help beyond the text and course staff was received).