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. In order to render your string, interpret the characters of the string as following:
Your program should be able to make a plant created from a grammar file provided on the command line. For example:
Proj2 -g 3 -a 25.7 plant1.txtshould generate a plant 3 generations old using the grammar from plant1.txt and a rotation angle of 25.7 degrees. 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
An example of a plant created by this system:
More information about L-systems can be found here.
We will be using FreeGLUT, an implementation of the OpenGL Utility Toolkit (i.e. GLUT), which is installed on the UMBC GL system at:
/afs/umbc.edu/users/o/l/olano/home/public/freeglutGLUT 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 will perform your rendering in the display() callback function, which is called whenever the window is being re-drawn.
The OpenGL libraries are installed on the university GL system. While it is possible to work remotely using ssh, you are encouraged to work locally on one of the OIT lab machines (just reboot into Linux). Some sample code for using GLUT in Linux is located at:
/afs/umbc.edu/users/r/h/rheingan/pub/435/Proj2
For more information about OpenGL and GLUT, you have several resources available:
Submit your assignment as 'Proj2'. 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).