Project 1: Final Iteration

The inspiration of this study is phototropism, which is the way trees grow towards the light source.

Here, I’ve created an algorithm that generates a probability tree. The probability of where the next branch will grow depends if the light source is on the right or left.

Below, the number of iterations, i, is set to 100. Meaning there are 100 branches. The general direction of growth is towards the sun. However, as the direction of the next branch is entirely probabilistic at each junction, the position of every branch is random.

Sun positioned to the right of the tree:

Sun positioned at the left of the tree:


I’ve added an element of interactivity. After i iterations, we call noLoop(). When the mouse is clicked in the window, loop() is called and a new tree at position mouseX will be generated.

For this, i set i = 30 so it won’t be too cluttered

What could’ve been done better?

Currently, the whether the tree grows to the right of left only depends on the x coordinate of the light source. i.e., sun on the right, tree grows to the left.

Imagine a line drawn from the sun to the base of the tree. Let’s call this the source line. I’d like for the branches to converge towards the source line so it looks like it’s growing towards the sun, and eliminate the branches that grow towards the ground.

Also, I would have liked to make the animations smoother. Currently in each frame, 1 branch will be drawn. I’d like for each frame to be a part of a branch, so the process of the branch growing can be seen.


Reflection Essay – Closed systems: Generative art and Software Abstraction

Watz states “Inspiration taken from processes found in nature is common, with the tension between organic and mechanical forms every present.” I personally find this statement about generative art interesting. The way nature acts is dependent on many different factors of varying level of influence, with each factor holding a certain probability.

For example, in a controlled environment of a fish tank, the amount of ammonia, which is harmful to fish, in the water at a given time is largely dependent on waste produced by fish (more fish = more ammonia), and the ammonia to nitrate conversion (harmful ammonia becomes harmless nitrate) by bacteria. Bacteria growth depends on oxygen levels, which depend on respiration rate of water plants, which depends on light intensity. Even in a controlled environment, there are already so many factors, which will take a lot of time to calculate by hand.

Thus, an algorithm can be used to consider all these factors, and simulate the ammonia levels in the fish tank. Since there is a probability attached to each factor, the end result becomes unpredictable to an extent.

Watz also states that “Programming errors can lead to serendipitous discoveries, and one does well to embrace one’s mistakes.” I agree with this statement. When reverse engineering to produce a desired result (e.g., to create a computer simulation of something in nature), there are many trial and errors one will face. As one tries to head towards their goal, the errors are unpredictable and to goal-oriented individuals, they are seem as a step backwards and unwanted. However, it’s only through such processes where one can stumble on a discovery.

In conclusion, GA is largely inspired by the unpredictability of nature and to appreciate GA, one must be able to embrace instability and errors.

Exploratory Study: Phototropism

Phototropism is essentially how a plant grows in responds to light, either positive phototropism (towards the light) or negative phototropism (away from the light). I’d like to explore on the factors that contributes to the extent a plant grows towards (or away) a light source.

At each junction, a plant can decide to grow a leaf towards the right or left. With even exposure to light, the probability is 0.5 for each direction. With exposure to light biased to the right for example, the there’s a higher probability for a leaf to grow there. We can experiment different light sources by defining the intensity and shape. E.g., an outdoor plant will receive direct sunlight which is round and have high intensity while an indoor plant will receive sunlight from a rectangle window which may have day curtains, having low intensity.


Assuming even light exposure, we generate a probability tree using an algorithm. Each route starts from the same position, and based on a probability to turn left or right at multiple junctions, a route will be formed with a limit of n junctions. Since each decision at each junction is a probability, each route created will take different paths.

After, we try to add on the effect of light. We can input a single light source as a point or an area. Since intensity = 1/d^2, the further a plant is from a source, the less intense the light.

Final Project: Popeye the Papaya

Popeye the sailor man! Here, he isn’t really a sailor man, but more of a papaya?

How I came to think of this story was when I was amazingly helping my mom cook dinner at home. I’ve never stepped foot into the kitchen, and I was tasked to do the most important thing, which was to cook rice. I spotted some grains of uncooked rice behind our rice container, and started thinking, wow it must be sad for that grain of rice.. It took so much energy and resources for it’s parent plant to painstakingly (at least what I think happens) grow out this one grain of rice, and through the process of harvesting, milling and packaging, there is always that possibility of it getting wasted. I just had to wonder, “How would I feel if I was that grain of rice? I’ve gone through so much just to be forgotten.”

Well, now that I think about it, it was a really uneducated thought hahaha. I could’ve been thinking about food waste, but there I was, afraid of hurting the feelings of a non-living grain of rice.

So that led to this, showing how happy a papaya seed would be if it were to be successful. Enjoy

This papaya starts stranded in the middle of the ocean. How, when or why it got there was a mystery. How this papaya can float in water, is also a mystery.

In this papaya, there lie an weary papaya seed. Stuck floating in this seemingly endless ocean, and probably forgotten by the rest of the world, what would her future hold?

Guess that papaya lucked out. It manages to reach land away from a dangerous erupting volcano.

Shocked by reaching land, the seed became happy. She saw some hope. Her growth into a papaya seed was not going to be wasted.

Tok tok tok.

The bird pecks at the papaya and ingests the seed. Would this be the end of her life? Digested or not, the seed was already happy to be of good use by giving the bird some nutrition.

Instead, the bird poops the seed out. Life is always full of surprises, isn’t it?

The seed finds herself in the middle of a forest. With surrounding water and nutrients, the seed spreads it’s roots deep into the ground. This is one ambitious seed. She’s going to grow into a big strong tree and she knows it.


Finally, the adult tree grows up. Providing her surroundings with resources, this tree is contended, and even works to produce papaya seeds herself.