Project 5b: Voxel-Space Plants

CS 7492, Spring 2017

Due: Friday, April 28, 2017

Objective

The object of this project is to familiarize yourself with a virtual plant model in which the growth is influenced by the plant's environment. You can create any kind of virtual plant that you wish, so long as it demonstrates environmental growth factors such as preference for lighted areas, spiraling around pillars, or phototaxis.


Voxel-Space Techniques

This project is based on Ned Greene's paper, which you should read prior to working on this assignment. You can find the paper here.

This project is more open-ended than prior course projects. You can make your own choice about what kind of plant that you wish to simulate. You can select vines, bushes, or trees. The leaves of your plant may be any geometric form that you deem appropriate. You can model your plant based on real-world plants, or you can make up your own alien plant life form.

You have considerable freedom in this project as to the type of plant that you simulate. There are, however, a few requirements for this project in order to make sure you challenge yourself sufficiently. Here are the requirements of your plant growth simulator:

Beyond the above requirements, you are free to embelish the simulation in any way that you see fit. You can add various GUI elements to your code, such as buttons and sliders to help control the plant growth. You can vary the diameter of the branches based on their age. You can add flowers to your plant. If you like, you can create multiple species of plants, including plants that interact with each other. You may wish to animate the plant growth process, similar to a time-lapse video.


Suggested Approach

There are two main aspects to your plant simulator: creating a branching structure, and influencing the direction of growth based on the plant sensing its environment. You should begin by creating a method to grow branching structures. I recommend that you use a method similar to Ned Greene's approach, where you add segments to a growning tip. Based on a random number, you should occasionally allow the growing tip to split, creating two segments that will form two branches. You should experiment with branching probabilities and branching angles until you get results that you like. You may wish to keep some history of the last branching event along a growing branch, and use this to affect subsequent branching events.

The direction of the newly added segments can at first be random. Eventually, however, you will need to bias this direction according to what the plant senses in its environment. You may also decide to terminate the growth of a tip under some circumstances, such as too little light.

The Voxel-Space Automata paper makes use of 3D grids that assist in a plant sensing its environment. One of these grids is used to speed up ray tracing so that the plant can sense the sky and/or the sun. This kind of grid simply specifies occupancy (filled or empty cells). The other grid is for sensing proximity to environmental objects such as a pillar. This grid contains per-cell distances to the given object. You may want to pick one or the other style of grid to use, depending on which sensing you wish your plants to demonstrate. It is also possible to perform ray tracing and distance calculations without a pre-calculated grid. It is up to you whether you want to use a grid-based or a gridless approach.

If you do decide to use a grid, you will need to be able to place objects in the grid. I strongly recommend that you limit yourself to voxelizing simple objects into the grid.

If you plan to use use occupancy grids, use axis-aligned blocks as the objects in your environment. Each box can be specified by six numbers: three to specify the minimum-value coordinates in x, y, z, and three more to specify the maximum-value coordinates of the box. Starting with a zeroed-out occupancy grid, a new box can be added by looping through the x, y, and z ranges for the box, and marking the appropriate grid cells as filled.

The purpose of the occupancy grid is to assist in fast ray tracing towards sources of light. Moving from one grid cell to the next is usually referred to as DDA, and you can read about this method here. This approach is very similar to the way in which a description of a line segment is rasterized into pixels. Once you have fast ray tracing implemented, you should cast multiple rays towards the sky or the sun's path from each growing tip to determine the direction of growth and/or whether to terminate the tip growth.

If you are implementing proximity grids, I suggest that you use cylinders as your environmental elements. Each cylinder is defined by a location on the ground plane (call these the x,y positions) and a radius. Loop throught all of the grid cells, and determine the distance along the x,y plane from the current grid cell to the cylinder's x,y position. You can entirely ignore the vertical (z) direction in this distance calculation. Place the distance in the proximity grid. This creates a cylinder that is as tall as the grid.

Once you have the ability to sense distances to other objects such as pillars, you should use these distances to affect the way your vines and/or other plants grow. Ned Greene used distances to keep a growing vine adjacent to a pillar. He also incorporated a twisting tendency so that the vine would spiral around the pillar.

Once you have the ability to affect the plant growth based on environmental factors, experiment with different parameters and objects in the environment. Create a growth model and an environment that demonstrates the effects that you seek to model.


Programming Language

For this assignment, you may use any programming language that you wish. You may use Processing, but you are also free to use any other language instead.

Project Presentations

Each of you will demonstrate your project to the class. These demonstrations will take place during the time-slot that has been assigned for our final exam. You can demo your project either by playing a video or by giving a live demonstration. These project demonstrations will be short -- five minutes maximum. Plan to bring a laptop to class during project demo day.

Turning In Your Assignment

You will turn in a write-up that describes your simulator and the plant that you created. Include in this document some still images of your plant. Your project description can be a PDF, an MS Word document, or an HTML document. Also, you should turn in the source code for your project. You will be graded based on your project presentation and your write-up. Although I may look through your source code, I will not attempt to run your program. Your written description and your source code should be zipped up and turned in on T-square.


Authorship Rules

The code that you turn in must be entirely your own. You are allowed to talk to other members of the class and to the teacher about general implementation issues. It is also fine to seek the help of others for general programming questions about Processing. You may not, however, use code that anyone other than yourself has written. Code that is explicitly not allowed includes code taken from the Web, from books, or from any source other than yourself. You should not show your code to other students. Feel free to seek the help of the teacher for suggestions about debugging your code.