The first thing I did when we started this project was to bring out every single book that I could find about Processing and interaction. And the first thing that I also realized is that it wasn't maybe the best thing to do when you're trying to come up with an artistic and creative solution. I read a few really good things in these books that I really going to use further in my research but as more I dug into the books the more I felt that I wanted to create more, and read less. The more I experiment with Processing the more I will be needing the books for further development so the books will find their natural way back into the whole project.
So what I did was to start looking more into tutorials and reading about how to create moving objects. I made a problem for myself: How can I get a specific circle to move across the screen. This is something that I've been playing around with before so as soon as I had made that happen I added more circles, and made them move differently on the screen. And at this point I started to play with a function in processing called: random().
random() is a function that will render between any number that you tell it to. If i for example call the function random(100), Processing will draw any random number between 0-99,9.
In this sketch I've used the random() function to draw copies of 3 different circles moving across the screen.
So the next experiment was to play around with colours and using the random() function to make random colours and random sized circles.
This is how the sketch looks. To explain a bit what I'm doing here: I set the image size to be 600x600 pixels and using the storkeWeight(5) to indicate that I want the stroke on my circles to be 5 pixels wide. And by using noFill() I say that I don't want any filling in my circles. The background is set to (255) which means that it will be white. Processing uses RGB colours (red, green, blue) and RGB goes from 0 - 255. 0 = Black, 150 = Red and 255 = White, to name a few examples.
Now I want to draw my circles. I uses the float variable which is a type where data is stored in the variable. float() is stored as floating point values and are use for decimal numbers which could be anything from 3.1484639, 9,54 and so on.
I then use these float() variables to create my ellipse which need 4 specific points to make an ellipse. You have the first x that indicate the x-axis (where the ellipse will be placed) then the y which indicate the y-axis so now we know where the circle will be places. Then we have the 2 remaning ones (d) which tells us the size of the circle, the first for width and the last one for height.
As you can see, I've used the random() function in my float variable so every circle will be created randomly on the screen. The last thing is the colours of the circles. I've used the stroke() function where you write 3 different variables to decide the RGB colour on the stroke and here you could also see that I've used the random() function so every stroke on the circles can be from 0 =black to 255 = white.
This is the results that I got with this sketch. Really fun to just see these circles popping out in random sizes and colours. So these are the rules and constrains I put on this particular sketch and by changing the rules you get a completely different outcome. This what I love about this kind of creative programming, a medium that is so deep and when you master it it's only your imagination that set the boundaries.



No comments:
Post a Comment