-
Random Circles
This is a small sketch that helps us understand the potential of the random() function and one can start using randomness in their work quickly. size(600,600); smooth(); int circleNum = 50; noStroke(); for (int i = 0; i<= circleNum; i += 1) { fill(random(255), random(255), random(255), random(255)); ellipse(random(width), random(height), random(width), random(width); } Next is an…
-
Experimentation
The setup() function must always precede the draw() function, and is used to define the initial properties of the sketch such as the size of the sketch. The size() function when used within an active mode sketch must always follow the setup() function before any other statements. If we had images to display in our…
-
Editing the smile
Our smile drawn with the arc() function looks fine but needs a bit of work. Although you cannot see it the arc actually has a fill. In order to see the fill we will first have to remove or hide the ellipse, but we’re happy with the way the ellipse looks so instead of deleting…
-
Aliasing
You might have noticed that the ellipse is looking a bit pixelated and not very smooth this effect is known as aliasing and is often counteracted with the effect of anti-aliasing which creates the impression of a smoother looking rendering. Fortunately in Processing we have a function that is made exactly for the purpose of…
-
Hello World 1.2
Processing is a language that was made to create visual representations of your code really easily, and as a result the developers of Processing have provided us with pre-configured functions for drawing primitive shapes much like you would expect in a drawing program. Shapes such as rectangles, ellipses and triangles amongst others are known as…
-
Formatting Text
You might have noticed that the text is supposed to be in the center of the Display Window but looks more like it’s leaning to the right hand side of the window. Processing allows us to align text relative to the coordinates we specified for the text() function’s X and Y parameters. The relative positions…
-
Hello World 1
Hello Display Window: Hello World 1.1 In the revised version of our Hello World Program we will start using the Display Window, firstly to display the original character set “Hello World” then to display a few shapes too. The text() function The text() function is the first function we will use to draw to the…