Offscreen drawing

Making my way through the Offscreen drawing recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to: declare a PGraphics object and then initialise it with the createGraphics function inside the setup function. use the createGraphics function to create a new transparent image to be drawn on and …

Manipulating SVG files

Making my way through the Manipulating SVG files recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned: more about using the shape function to draw shapes in the display window how to declare the PShape object and create custom variables (snowFlake, small1 to small6 and big1) and the disableStyle, …

Drawing custom shapes

Making my way through the Drawing custom shapes recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned about some of Processing’s funky functions that can be used to draw custom shapes such as a star and a flower. I also learned about the vertex, beginShape and endShape functions.

Calculating points on a curve

Making my way through the Calculating points on a curve recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to use the bezierPoint and curvePoint functions to calculate points on curves and splines. bezierPoint uses five parameters. The first four are coordinates for the anchor and control points …

Drawing curves

Making my way through the Drawing curves recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to use the bezier and curve functions to draw Bezier curves and Catmull-rom splines in the display window. For the Bezier curves in this example, 0 and 20 are the coordinates for the first anchor …

Drawing text

Making my way through the Drawing text recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to declare PFont objects for the fonts to be used in the Sketch and set the second parameter of the textFont function to determine the size of the text. For example, textFont …

Drawing basic shapes

Making my way through the Drawing basic shapes recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned how to use the rect, ellipse, quad and triangle functions to draw basic geometric shapes. I also found it interesting how two for loops are used to create the grid background pattern. I’m curious …