Generative Design: Book Notes


Processing notes:

FunctionFunction
size (640, 480, JAVA20);The standard renderer; this is used if nothing else is specified
size (640, 480, P2D);Processing 2D renderer; this is quicker but less accurate
size (640, 480, P3D);Processing 3D renderer; this is quick and is reliable on the web
size (640, 480, OPENGL);OpenGL renderer: this uses (and requires) OpenGL-compatible graphic hardware. Here the graphic card and CPU share the computational efforts, making it the fastest renderer 
translate(40, 20);rotate(0.5);scale(1.5);The coordinate system is moved 40 pixels to the right and 20 pixels downwards, then rotated 0.5 radians (rotation in Processing is in a clockwise direction) and finally scaled by a factor of 1.5
BooleanLogic values – true or false
intIntegers
floatFloating point value (decimals)
charA single character
StringCharacter string/text
arraysTo manage a list of values, indicated by square brackets [ ]
Int roundedValue = round (2.67)Round a number. The rounded Value is then 3. 
float randomValue = random(-5, 5);Produce a random number between -5 and 5
float cosineValue = cos(angle);Calculate the cosine of the specified angle
mouseX, mouseYCalculates the exact coordinates of the cursor
mousePressedTrue if one of the mouse buttons is pressed
keyPressedIndicates if a key is pressed, the last key pressed appears in key
mouseReleased() When the mouse button is released
Event handlersThey are called when the corresponding event occurs – i.e. when a mouse button or key on the keyboard is pressed
mouseMoved()When the mouse is moved
ConditionsIf, if… else, 
Switch commandTo differentiate between multiple values of a variable
loopsUsed to execute a particular command several time within a programme
For loopFor a loop to be executed a particular number of times
While loopContinues till a certain condition is fulfilled
functionParts of a programme that appear in a similar way in different places
noCursor()Makes the cursor in the display window invisible
widthSystem variable – uses the width of the defined canvas
heightSystem variable – uses the height of the defined canvas

Resources:

  1. Generative Design Website with p5.js codes

Leave a Reply

Your email address will not be published. Required fields are marked *