Introduction to Digital Arts & Sciences
Fall, 2010

CAP 3027
HW 04c (BONUS)

 

Summary

Modify your HW #04b so that it supports stochastic branching and flowering.

Branching

Before a stem grows, "roll a die" to determine whether it should branch (this check is performed every step). If it does branch, a random number (1-5) of branches will start at the end-point of their parent stem: each will initially have the same x, y, theta and r that their parent has — but each will have its own randomly determined direction. The total length of a branch, from root to tip will never be larger than the total number of steps.

Flowering

If a stem does not branch in the current step, then "roll a die" to see if that stem will flower. Having flowered, a stem does not grow any more. You may draw flowers any way you like (as long as they look "flower-like"); I used the Graphics2D's drawOval() and fillOval() to make circles.

Note

Even if you know more, you are limited to using the techniques covered up to this point in class.

This website is an original work, Copyright © 2010 by Dave Small. All rights reserved.