A Few Notes Starting August 29, 2018
From Chapter 2 Don’t neglect Zoog. He’s your friend! Textbook website: learningprocessing.com Work exercises at home… Remix
Processing measures degrees or radians of a circle differently: 0 degrees/radians is located on the right side of the circle as expected. However, it increases in the clockwise direction rather than counterclockwise. Angles can be specified: in radians; in degrees (by converting into radians); eg radians(90) or by special names of common angles, stored as variables.
Formula: Degree *( pi/180)
void setup() { // Called once when program starts } void draw() { // Called repeatedly while program runs
void setup() { size(200, 200); } void draw() { background(255); void draw() { // Try moving background() to setup() to see the difference. background(255); stroke(0); fill(175); rectMode(CENTER); fill(#ff0000); rect(mouseX, mouseY, 50, 50);
void mousePressed() { // Called when the mouse is pressed } void keyPressed() { // Called each time a key is pressed frameRate(fps); Sets number of frames displayed per second. i.e. the number of times draw() is called per second. Default = 60.
Use save() in your homework The save() function is placed within draw(). It generates a file based on the name you specify. Example: Save(bunnypic.jpg);