/* exercise 11, task 3c */

module ApicalBud(int age) extends Sphere(1).(setShader(RED));

module LateralBud extends Sphere(0.5).(setShader(GREEN));
   
module Flower extends Cone(5, 6).(setShader(BLUE));
   
protected void init()
   [
   Axiom ==> D(0.5) L(10) ApicalBud(0);
   ]
   
public void grow()
   [
   ApicalBud(t), (t < 7) ==> F0 LMul(0.9) RH(180) 
                             [ MRel(0.8) RU(45) LMul(0.6) LateralBud ] 
                             ApicalBud(t+1);
   ApicalBud(t), (t == 7) ==> M(5) RU(180) Flower;
   LateralBud ==> F0;
   ]

