Friday, May 3, 2013

Photo-tropism simulation using Open-L Systems

As a part of my term project for the Simulation of Biological Systems class - Spring 2013, I implemented an L System based tree growth simulation system that tries to simulate photo-tropism in plants.



The essential idea is to use Open-L systems for modeling plant-environment interaction. The work is also inspired by the work on Voxel Space Automata by Greene.

The essential idea is to compute lighting estimates at each of the apices of the plant when growing it using L system grammar. This is done by voxel space ray-tiling - an efficient algorithm for doing this is described here. The query parameter of the Open-L grammar is used to query the environment at each apex (in our case, the environment is the voxel grid that is used for ray-tiling).

Blocks can be placed on the grid using an FPS camera to move around the scene. These blocks prevent light from reaching the plant (the lighting in the scene is considered to be ambient - the entire hemisphere contributes equally to lighting the scene).

A key decision that I made was to try to get the plant remain as faithful to the desired geometry as described by the L-System, while still exhibiting light-seeking behavior. To achieve this result, I use a 45-degree field of view at each apex to ray-cast into voxel space. The result (occlusion/non-occlusion), serves to populate an intensity grid, that is a measure of the light in a particular direction in the world. The highest intensity-grid value is picked and:
a) The angle of growth is modified to grow towards that location.
b) The length of growth is multiplied by the normalized intensity value for the grid.
These two factors serve to control the bending towards light, and the vigor of growth(a branch in shade will get less nutrients, and thus its growth will be slowed).

Here's the presentation that details the work involved in creating the project.

Code: https://github.com/indivisibleatom/lSystem (there are a couple of path hardcodings in there :) - will clean these up soon).


Demonstration of light seeking behavior:

OpenL system allows for interaction with environment to determine angle and length of growth of branches by voxel-space ray-tiling - we see that growth is retarded in places with obstructions and that trees try to grow around obstacles.


Video of the system in action:



No comments:

Post a Comment