The coding programme that we have learnt this week is called Processing. This programme is a bit different than Three.js playGnd that we learnt last week. Instead of having an augmented interface in which the coder can see what is happening in real time, Processing the coder has to code and then test. The potential for Processing is much greater in the fact that the animation and interaction side is not limited to the basic 'snippets' like Three.js playGnd. This however means that the interface of Processing is a little bit more complex.
My first experiment and respective design process using the programme Processing is as follows:
![]() |
The first step was going to obtain the basic setup code for Processing that Tim had open sourced to us. |
![]() |
Then it was a case of getting the open sourced code from Tim that enables us to create jpegs from our 'coding canvas' by simply pushing the 's' button on the keyboard. |
![]() |
Also I have used the line function code "line()" to add a line from the top left hand corner - (0,0,50,50). The four numbers in the brackets refer to the: 1. x-axis value (where the line will begin from on the x-axis) - 0 being the top left-hand corner 2. y-axis value (where the line will begin from on the y-axis) - 0 being the top left-hand corner 3. xlength (how many pixels my line will be along the x-axis) 4. ylength (how many pixels my line will be along the y-axis) In order to see my line (due to the fact that default stroke colour is black) I have had to change the stroke colour to (255) which is white in order to see it. |
![]() |
To begin to understand the parameters better, I have then fiddled with the length of my line on both the x and y-axis. |
![]() |
By changing the first two numbers in the brackets (0,0) to (500,250) I have now changed the origin to the centre of my canvas. And thus the line will extend from the centre of my canvas now. |
![]() | ||
In this screenshot I have added a variable to my line function. Instead of having a set line length that was (100,100), I have changed it to the variable (mouseX, mouseY). This means that the line length will be determined by the movement of my mouse cursor. This can create very interesting shapes as one moves the mouse around the canvas. I also changed the origin back the top left-hand corner (0,0).
|
No comments:
Post a Comment