You may work with one partner on this assignment. In this lab, you will design and implement a grammar based model for rendering plants and trees.
git fetch origin git checkout -b project07 origin/master git push -u private project07The above commands assume that the default class code is on the origin remote, and your personal remote is named private. Furthermore, your working directory must be clean (no uncommitted changes to files under version control), before checking out a new branch. If this is not the case, add and commit you changes locally before switching to a project07 branch.
Once you and your partner have pushed the project07 branches, you can each checkout a shared07 branch to follow your partner's changes
git fetch partner git checkout -b shared07 partner/project07Note you should not merge into either the master, shared, or shared07 branches as you will later be unable to push your changes. Make sure you are on either the working or project07 branch before merging.
This assignment is fairly open ended. Here are my requirements
parseFile in plant.cpp reads an input file as described above and stores the grammar as a small dictionary. The dictionary maps symbols to a vector of possible replacement productions. A production is simply the weight and a vector of replacement symbols. By storing the symbols in a vector and by separating symbols by spaces in the input file, you can have multi-character symbols, e.g., A1, B17.
The first task to complete is the function derive or a similar replacement. What this function does is derives a new vector of symbols by applying the grammar rules to the current vector of symbols (initially just the start symbol). Complete this function and have a method that printPlant() that displays the derivation correct result.
Next, modify PaintGL or drawTree to look at each symbol in the derived plant vector and assign a geometric interpretation using openGL commands. These could be drawing branches, leaves, rotating, pushing, popping, etc.
You may want to apply a global scaling factor to keep you plant on the screen. Keyboard controls can help adjust this factor.