Monday 12 April 2010

Processing Development Part 1

Processing Development Part 1

Now I have decided what my plan is going to be like, it is now time to experiment with various codes and see what I can do with them. The rules imply on the basis that a processing sketch must use Animation and an XML RSS feed from Plymouth's ARCH-OS websites. We are not allowed to use interactivity with the sketch so it's only visual-based.

My first stages are to basically produce the circles I need and draw them onto the sketch along with some form of animative movements using trigonometry (which is awkward). The circles can be produced like this:





The code and above displays the foundations of the 'stage' area. Starting at the top, I have created an integer which declares the name num and the number is 10 (this can be changed to any number and this will be for the amount of objects (circles) in the sketch.) It can be any number as long as it's not too big as the amount of processing will cause the computer to crash.

An array is declared to announce the name Circle and circles which are used later as a Class and in For Loops to help duplicate the circles I need.

I have then created a void setup(){ to produce some of the extra features of the sketch such as adding smoothing, establishing the size of the sketch along with adding the frame rate which is set to 30. A for loop begins here which sets up circles I need for the sketch, int i is declared and is used as a new circle to create a Random generation of circles (in this code there is 5 variations of movement for the circles). The size of each circle is set to 15.

I then established a void draw(){ which projects everything onto the sketch. I have currently provided a basic shape such as an ellipse to draw as my boundary. This will be filled to become a dark background. The ellipse and it's fill doesn't need to be there but when the trigonometry it will be needed to check if the moving circles are in the right path. Another For Loop statement is used as an 'Updater' to constantly update the position of the moving circles on the drawed sketch. The circles[i] is used from For Loop in the void setup(){ to produce the sketch.

No comments:

Post a Comment