This project explores the realm of Object Oriented Programming (OOP) – how it works and why it is so powerful. Students will be introduced to and become familiar with the new the terminology of classes, polymorphism, inheritance, and encapsulation. OOP techniques can be used in many ways and in many contexts and can greatly help in managing larger projects. We will be looking at OOP through the lens of artificial life, paralleling the function and structure of this approach with natural processes. We will be looking at what a simulation is and how we can develop one.
Diverse responses to this brief are encouraged. Although we will be using Processing as our tool for exploring this subject, outcomes can range from simple code ‘creatures’, to agent simulations, to enhanced re-purposed previous code with OOP implementations. This project is intended as an introduction – students are expected to continue study and implement these powerful OOP techniques within their work thereafter. Code examples will be distributed as the weeks progress which students can modify to help develop ideas and responses.
A engaging OOP implementation created in Processing, and any accompanying code studies or experiments.
Creating organic looking shapes.
3 random walkers (created without an array) 2nd one with blendMode(ADD);
Leaving a trail behind by creating a rectangle with a lower opacity.
Giving each point a colour of its own by passing it through the class.
Dots with names.
Connecting the people with lines.
This stops the dots from moving off the screen.
The homework task is to take a sketch from last years creative coding and create a class based on our workshop from the project launch.
I chose this simple sketch from last year which was an ellipse following the mouse. It was filled with a small opacity so when it stacked up it got more opaque. I chose something which was very basic to see if the code could easily change when a class is introduced.
These are some screenshots of the code once I applied the class and changed/added some code. I really like the outcome already even though there is still a lot I could add or experiment with in this sketch like setting a container, mouse clicks that determine where the circles start a new sketch randomly or making each ‘painter’ a different colour.
This code uses constrain keeping it with the boarders of the screen.
This code didn’t use the constrain code however I do enjoy it. When the shapes are allowed to run free (or as free as the code written by be) it seems less controlled also I enjoy the occasional flashes on the screen when you let the code run over the boarders creating a less manic visual like a single curve on a dark background.
What is object orientated programming?
In the workshop we spoke about personality being a bad example of data as it would be hard to measure personality doesn’t’t exactly equal to 3.4 or 10.2, however what if you created a sketch with equivalent actions based on type of personality and had these actions be performed by simple shapes on the screen as representations of personalities? For example a bubbly personality could be the equivalent of bright cycle which moves very fast on the screen, whereas a gloomy personality would be a darker colour drawing less shapes on the screen this does also kind of link to moods. Anyway, it was just an idea that popped into my head which I have been considering. I do realise that the outcome of this wouldn’t be scientific but purely biased on the artists views and opinions.
An Array Loop.
PVectors -processing Vectors.
Examples on open processing which I might look into and take inspiration from.
Once the mouse is pressed and dragged the shapes are drawn and then they get big and small kind go like a pulse which is much more effective when moving rather than these still screenshots.
I want to try and implement my own text file into processing and create something out of it just to practice my coding. I’m thinking of creating a baby girl name generator based on most popular names or something like that as a template.
I found this website: https://www.ssa.gov/oact/babynames/limits.html
For now I gave up on the names file I’ll have to do some research on how to read and display the files.
11 February 2019
I found an old sketch that I want to experiment with and place in an Array List.
The sketch draws itself with the help of sine and cos which creates an illusion making the circles look like an animation which is moving.
Below is an early irritation of the sketch implemented in an ArrayList. I will continue to amend it and make changed however I’m still not sure whether I want the ArrayList sketch to look similar to the original or if I should continue to experiment and make more changes to the over all dynamic and aesthetic of the sketch.
Working on a new sketch. I want to add velocity and maybe work with some kind of simulation.
I will insert images of the progress of this one sketch (there is a lot) I have been editing and changing along they way trying to understand the code more and make it my own.
When mouse is pressed these circles how up the longer It is pressed the longer the continuous cycle is, the shapes are moving with a velocity.
The more the mouse is pressed the more circles show up, moving using PVectors and velocity.
In this sketch I added blendMode creating a light reflection effect which I really like, still the same principal the more you click the more circles appear.
THE DISCO LIGHTS! same principal as above.
More disco lights, this one looks more dynamic when played due to the larger shapes and the changing random size.
The bouncy ball, I think this sketch would be effective if each of the balls left a slight shadow behind I would do this by inserting a rectangle with a low opacity however I was focused on moving forward so I didn’t get around to it.
This sketch is harder to explain as it moves and when the mouse is pressed it stops which is hard to portray in still images.
This is the sketch I am currently working on to create the yellow circles you have to type something on the keyboard and if you press the mouse the screen with the small circles appears. This sketch has inspired a concept as I am considering creating a metaphor for messages we type. We type thing up close to us and everything looks pretty and nice but in reality your information could be anywhere and hackers could have access to it which shows a kind of harsh reality of interacting with computers, in other words ‘Watch What You Type’. Literally because you’re watching what you’re typing pun intended.
I think this sketch will be my final. To make the circles appear you have to type something using the keyboard, if you then press the mouse bar you see the circles as way smaller and the whole screen gets darker the more circles you produce. This is supposed to represent putting yourself out on the internet by speaking and publishing personal and private information for the public domain without your knowledge.
Because this project was extremely short I decided to really focus on one area and explore it and learn it fully which is why I kept my main focus on Array Lists and becoming familiar with classes when exploring code. I decided, for me personally, it would be much more rewarding if I understood what I was doing fully which is why I started by editing old sketches and then creating sketches from scratch. I would like to re-visit this project in the future and create a real simulation/ecosystem but for now I am happy with my outcomes as even though they are simplistic I understand them and this gives me the knowledge base I will need for the future if I ever wish to use this platform to explore a concept or topic. I hope to go back and watch/read more of the Dan Shiffman’s ‘Nature of Code’ as this seems to be a great source of knowledge. I also hope some of the concepts/ideas of my colleagues will inspire future work as everyone had varying/diverse ideas and approaches which was very refreshing and eyeopening. I enjoyed that this project allowed flexibility and it allowed everyone to approach it from different angles however I do wish it was longer as this would mean everyone could potentially have enough time to explore a little more of everything rather than having to give up on certain paths of learning. Overall I am happy with what I managed and I hope to create more work using what I learned in the future.