Homework is due on Wednesday by 4pm; you can drop it off on the 4th floor front desk. We talked about programming (loops and recursion), and 2D-texture mapping. Next week we will continue with 3D-texture mapping.
1. [Reading Assignment] Read chapter 6 on texture mapping in Wolfe. 3D Graphics, A Visual Approach.
2. [Lawn, 20pt] Extend the lawn macro to include the following functionality:
Then build a simple scene using the macro (no additional objects, just adjust lighting, camera, and your parameters). You can start working of hw4_lawn.pov which already contains the parameter declarations (also note that the MakeBlade macro has changed: it now does not take the position of the blade as an input anymore, all of this can be done in the lawn macro).
3. [Fern, 30pt] You want to write a program displaying a fern. Write a macro fern(n, len, wid) that builds a fern of height len and width wid recursively. fern(0,len, wid) should just be a cylinder of height len (and fixed radius, around 0.005), see below.
Then fern(n, len, wid) should be built recursively by alternately placing ferns built as fern(n-1, adjusted length, adjusted width) on the left and right. For example, here are fern(1,1,0.5), and fern(2,1,0.5):
and finally, fern(3,1,0.5):
You can either start from scratch, of use the hw4_fern.pov template, which contains the basic structure of a possible program to build the fern. If your fern doesn't quite look like mine, no problem, maybe it'll look much better.
4. [Trees, 40pt] Plant a tree. There are several macro-packages for building trees, have a look at http://www.oyonale.com/ressources/english/sources01.htm, which lists several of them. Pick one, get familiar with it, and use it to build a tree. Use the tree in a simple scene (just trees and lighting are ok). Note: for this part, on top of your pov-ray file and bitmap, submit a description of what tree to tried to build, and how you used the parameters of the tree-package to achieve that effect.
Submission: