Thursday 4 August 2011

The Code

My initial idea was to start with a fan like structure, and then see how I could make small changes to the code to create new forms. The variable 'mega' set the amount of repetitions that I wanted each form to have.
The advantage of this was that by balancing 'mega' with rotation and the 'obSize' variable, I could change overlap and frequency. This value would create a very different effect when changed.

To take advantage of the format of the canvas (much longer then high) I used transform to move the grid to the middle-bottom and start the fan shape from this point.

The most important part of the code is the ‘for statement’ and the value of rotation. The ‘for’ contains all three ellipses and one rectangle. In the example of code below for a fireworks pattern I have also added random positioning to the Y value of the objects.

I decided to avoid ‘if statements’ for this project for the sake of simplicity.  

As a bonus, here is a basic grid patten I created as the suggestion of steven.

No comments:

Post a Comment