Wednesday, June 1, 2011

Exhibition

This is my final exhibition piece.


 
If/Else Statements

In programming, you can do many things just with a single line of code. But ‘if’ statements let you compare two options, and chooses one depending on whether its conditions are true or false. For example, if you were hungry, then you would eat. Otherwise, you wouldn’t. This is saying that if the ‘hungry’ condition was true, then you would eat. Otherwise, you would not do anything.
The ‘else’ part of this is just adding another option to the scene.  For example, if the hungry condition was false, then it would skip over the eating statement and you would exercise.
My project is a poster that depicts heaven and hell, and in between, the choices you make that determine where you might end up. It is similar to both a quiz and flowchart in the sense that it is asking you questions and depending on the answer you choose points you in a certain direction.
This illustrates my concept of if/else as it compares the two options, heaven and hell, and based on the questions which act as the conditions, determine which outcome you end up at. For example, if the question was “Have you ever stolen anything?” and your answer was no, then you would go up to the next question, else if you said no, then you would go down.
Therefore my project relates to real life as everyone makes choices everyday and this is represents my metaphor ‘Choices determine our path’.

Metaphor

My idea for a metaphor of if/else was to create a poster that displayed something that showed you could take multiple paths which led you to different results depending on the conditions you meet.

For example, this poster is a simple but good representation of if/else, as the flow chart has two different results, and depending on which answers you choose you either end up at 'change something' or 'keep doing whatever you're doing'.

Thursday, May 26, 2011

Programming term - If/Else Statements

Definition:

A conditional statement/expression or construct that perform different actions depending on whether a boolean condition evaluates to true or false.

Conditional statements are used to perform different actions based on different conditions. A boolean condition has only two values - either true or false. For example:

boolean tree = true;

This can indicate whether a particular condition is true, but can also be used to represent any situation that has two states, such as a lightbulb being on or off. 




The if statement consists of the word if followed by a boolean expression, followed by a statement. The condition is enclosed in brackets and must evaluate to either true or false. If the condition is true, then the statement is executed and the processing continues with any statement that follows. If the condition is false, the statement controlled by the condition is skipped, and processing continues immediately with any statement that follows. 

Example:
  if (cMoney < totalMoney) {
             cMoney = cMoney + 20;
}                                        

This is saying that if the cMoney is less than the totalMoney then add 20 to the cMoney and put that value back into cMoney until the condition turns false and reaches the total amount of money. If this condition is originally false, ie. the cMoney is equal or greater than the totalMoney, then it will skip over it to any other processing that concedes it. 


The next part of this is the else statement which gives a true and false condition. 

Example:
if (cMoney < totalMoney) {
             cMoney = cMoney + 20;
  }else{                                    
                                            String limit = "You have reached the limit"       

This is saying the same thing except it adds the else component which means that if the first statement is false, it automatically defer to the else statement where it will say "You have reached the limit".    


The last part of this term is the if..else if..else statements that can be used to select one block of code when there are multiple options. This can be used infinitely.

Example: 
 
if (cMoney < totalMoney) {
             cMoney = cMoney + 20;
          }else if (cMoney > totalMoney) {
             cMoney = cMoney - 20;
}else{                                  
                                            String limit = "You have reached the limit"       

This is adding another condition when the first one is false. It is saying that if the cMoney is not less than totalMoney  but greater than it, then it will minus 20 from the cMoney and replace it with that value, then continue on with the rest of the code after the conditions. 



One last thing about if/else statements are nested if's. This means that there are if statements inside the original if statements which means there are two conditions for the code to pass.


Sunday, May 1, 2011

Experimenting..

I stumbled upon a cool thing today. I found that when I changed the colour at one point, the original screen would be black until you clicked and the boxes collided, and suddenly appeared in colour. I thought this was a nice touch and enphasized the concept how it is not immediately obvious what it does, which causes you to experiment more and interact.

Editing

I think I know why they're sticking together now. I was fiddling around with the speed of the boxes, and changed them to 0.5 speed. But what happened when it collided with another box, was that it reversed its speed to -0.5 which I think may have cancelled each other out and therefore it to be stuck together in one place.

I changed the size of the boxes to be more random but in a limited range, and I want to do the same with colour, but i'm still trying to decide if and how I want the colour to change. On collision? Or on click?

http://www.openprocessing.org/visuals/?visualID=8517

http://www.openprocessing.org/visuals/?visualID=12869

I decided i wanted more visuals so it was more of a sound shape. I found these ripple codes in open processing and I tried to tailor it to my needs. How it worked was when you clicked, it produced a random ripple at that point. I want to make it so that the ripple is produced when the boxes collide.

Progression

Worked on the sound today. I found out that it was right, and i just needed to plug in headphones to hear it. I used the code from the 142 resources page and found that I didn't need the song.close() part as I just want my sound to play when a collision is detected. I put ding.play() into the collision part and saw that it was continuously playing that one ding sound when they collided. So I figured I'd have to put in ding.rewind() so that it would rewind then play the sound again each time. But now I noticed that it was playing two ding sounds as it hit. I was puzzled by this but then figured out that each box was playing its own ding sound which sounded like two in consequence because I have code for each of the two that collide. Thinking that was done, I played it again and now the boxes seemed to stick to each other when they collided and repeated this awful part of the ding sound. Hmm...

So, so far I have 5 boxes that collide (if unnaturally) with each other and bounce off the sides. It seems a little bland to me...

Thursday, April 14, 2011

Inspiration

I was inspired by this video i saw on Vimeo that makes tones that produce a circle which represents the sound. I wanted to create an interactive application like this that you can abstractly create different tunes, and lets you see the effect visually. I decided i want a similar sound to that, a tonal scale of notes. 





So I had a few boxes. Now i needed to add interaction. I looked at the processing website and other sites that gave me examples of interaction. I learned about the mouse functions such as mouse clicked and mouseDragged and researched everything relevant to them.

I looked at some examples of mouse clicked functions and extracted these qualities you could produce:

Definition - mouseClicked function - called when the mouse is pressed and released and changes the value of an object

Click and the object is instantly at your mouse - uses mouseX and mouseY to position
Gradual attraction - click and the object/s gradually go toward the mouse
Repel - click and the object/s run away from the mouse
On the mouse(mouseMoved) - moving the mouse across the screen automatically changes the value of the object, as it stays on the pointer
Change in form/colour - click and the form either completely changes to a random state or the colour changes
Creates sound/movement
Changes value depending on the position of the mouse click - uses pmouseX and Y
Changes value depending on the position of the mouse - ie change in colour in different areas


MouseDragged

Change in size or form - clicking and dragging the mouse changes a value depending on the direction and position of the mouse and drag
Change in tone/pitch - dragging causes the sound to change in melody or frequency
Drag - drags an object across the screen
Trail - dragging an object leaves a trail of some sort
Push - Dragging pushes objects around an invisible forcefield around the mouse
Rotate - dragging in a circular motion rotates an object making it seem 3D

Collision

 So i had gotten the shape and the basic idea of what I wanted it to do. I had boxes floating across the screen which didn't really do much. I started to think about how my boxes would act when they collided with the edges or each other. So I figured out how to make my boxes highlight when they intersected each other, but it wasn't enough.

With my animation I explored the concepts of collision and what happens when two solid objects collide with each other. I was inspired by this creation because you can pull the ragdolls and throw them against a solid object where they would crash and bounce off depending on how they hit it.

Transformation



This is my original storyboard for the interim presentation which shows my two ideas and how they work. I decided to go with the box idea because the bubble one was too overused and a little boring.

Wednesday, April 6, 2011

Reflection

What have you learnt so far, what helped and motivated you learn? Is there anything that you want to improve in your next project? Set yourself a goal and make a plan how you could achieve this goal.

Any key concepts and questions that arise – any connections you can make to your own experiences in design and with code.
  • Programming is a way to express visual ideas that normally cannot be expressed on paper, or will take many hours of labour. It can be a way to create art over time through animation.
  • Generative animation is animation that changes over time as well as every time you run it. Programming is the only way to achieve this form of animation.
  • Programming with variables can take massive changes and solve them in only a few lines.

Investigate the topic transformation. What does transformation mean? 

Transformation to me is about the interaction with your mouse or keyboard which makes the image move, sound, or change visually into something different. 

http://www.openprocessing.org/visuals/?visualID=8941


I found this one interesting because it  reacted to mouse movement with change in area and scale, as well as scrolling to change density and size.


http://www.openprocessing.org/visuals/?visualID=6753


This one is a bit different as it can be made to look 3D as you can click and drag to rotate it in any direction.

http://www.openprocessing.org/visuals/?visualID=22598

This one interests me as it introduces the concept of collision and what happens to an object when it hit another. The code actually has step by step comments on what each line does so I am currently trying to decipher what parts are applicable to me and what I can use to help my animation.

Monday, March 21, 2011

Final Wallpapers

These are my final wallpaper designs. I stayed very geometrical, and used colour to express and accent the image so it would be eye catching. The set works together as the accents of colour flow together, and it develops from being simple with just straight lines, to experimenting with gradients and subtlety with colour to create something new and more visually appealing. 










Inspiration

this is an image that inspired me because of the colourful lines and 3D movement.

http://www.openprocessing.org/visuals/?visualID=21319

First attempt


These were my first attempts at trying to recreate my sketches on the computer.


This one looks pretty standard to me, nothing really catches my eye.


This one was just based on what we had done in class.


One colour seemed boring, so I needed to think of a way to make it more interesting with colour.


I started experimenting with different shapes other than lines and triangles.

Sketches

These were my first sketches for my ideas of a wallpaper.