Review of ArT3 Programming Course David Meredith Aalborg University

Slides:



Advertisements
Similar presentations
Creative Computing. \\ aims By the end of the session you will be able to: 1.Move objects around 2.Write simple interactive programs 3.Use the mouse position.
Advertisements

Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
Lesson One: The Beginning Chapter 3: Interaction Learning Processing: by Daniel Shiffman Presentation by Donald W. Smith Graphics from text.
Introduction to Programming
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
A Quick Introduction to Processing
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Programming Project 1 Truth Table Lecture 03, file P1 Due January.
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
Lesson Four: More of the Same
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
IAT 334 Java using Processing ______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
Java Syntax Primitive data types Operators Control statements.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Lecture 3 IAT 800. Sept 15, Fall 2006IAT 8002 Suggestions on learning to program  Spend a lot of time fiddling around with code –Programming is something.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
Review Blocks of code {.. A bunch of ‘statements’; } Structured programming Learning Processing: Slides by Don Smith 1.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Functions Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Continuous February 16, Test Review What expression represents the zip car eligibility rules of at least 18 years old and no incidents?
M. Taimoor Khan #include void main() { //This is my first C++ Program /* This program will display a string message on.
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Processing Lecture.2 Mouse and Keyboard
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Arrays Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Introduction to Image processing using processing.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
CIS 3.5 Lecture 2.2 More programming with "Processing"
Lesson Two: Everything You Need to Know
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Arrays. An array is a collection “The Dinner offers an array of choices.” In computer programming, an array is a collection of variables of the same data.
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
Lesson Two: Everything You Need to Know
Test 2 Review. General Info. All tests are comprehensive. You are still responsible for the material covered prior to the first exam. You will be tested.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Computer Science I Recap: variables & functions. Images. Pseudo-random processing.
Computer Science I Looping. User input. Classwork/Homework: Incorporate looping & user input into a sketch.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Aside: Running Supplied *.java Programs Just double clicking on a *.java file may not be too useful! 1.In Eclipse, create a project for this program or.
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
Review Expressions and operators Iteration – while-loop – for-loop.
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Programming for Art: Arrays – 2D ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 16 Fall 2010.
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
Lecture 2 Arrays. Topics 1 Arrays hold Multiple Values 2 Accessing Array Elements 3 Inputting and Displaying Array Contents 4 Array Initialization 5 Using.
Arrays. 2 Why do we care (about arrays)? What if you have a whole bunch of cars (or aliens or balls or ???) bouncing around the screen? How do we keep.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
Objects Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
David Meredith Aalborg University
Basic Input and Output CSE 120 Spring 2017
Lesson Two: Everything You Need to Know
Computation as an Expressive Medium
Basic Input and Output CSE 120 Winter 2018
Code Elements and Processing Coordinate System
Mouse Inputs in Processing
More programming with "Processing"
Code Elements and Processing Coordinate System
Recap Week 2 and 3.
Basic Input and Output CSE 120 Winter 2019
LCC 6310 Computation as an Expressive Medium
Continuous & Random September 21, 2009.
Presentation transcript:

Review of ArT3 Programming Course David Meredith Aalborg University

Lecture 1: Introduction to Processing Drawing simple shapes point(x,y) line(x1,y1,x2,y2) rect(x,y,w,h) rectMode(CORNER|CENTER|CORNERS ) ellipse(x,y,w,h) ellipseMode(CORNER|CENTER|CORNE RS) Defining greyscale values – 0 = black, 255 = white stroke(n) (default is black) fill(n) (default is white) background(n) (default is grey) noStroke() noFill() Defining colours fill(r,g,b) stroke(r,g,b) background(r,g,b) Defining opacity (alpha) – 255 = completely opaque, 0 = completely transparent – Greyscale fill(n,a) background(n,a) stroke(n,a) – Colour fill(r,g,b,a) background(r,g,b,a) stroke(r,g,b,a) Defining line width strokeWeight(x) Defining drawing area size(x,y) Smoothing lines and edges smooth() Printing to console println(“a string”) Comments // comments rest of line /* comments region in between */ Program structure setup() and draw() Tracking mouse location mouseX and mouseY pmouseX and pmouseY Responding to mouse clicks and key presses void mousePressed() void keyPressed() Using Processing – Shift-Click Run to run full screen – Sketchbook – Publishing (Exporting) a sketch

Lecture 2: Variables and Conditionals Variables – Types int, byte, short, long double, float char boolean – Declaring variables int x; – Initializing variables int x = 2; – Global variables Defined outside setup() and draw() – Assigning values to variables x = 5; – System variables width, height, frameCount, frameRate, screen.width, screen.height, key, keyCode, mousePressed, mouseX, mouseY, pmouseX, pmouseY, mouseButton – Random numbers w = random(x,y) w = random(x) – Type-casting e.g., w = int(random(1,100)) Conditionals – Boolean expressions – Relational operators >, =, <=, ==, != – if (condition) {doThis();} – if (condition) {doThis();} else {doThat();} – if (condition1) {doThis();} else if (condition2) {doThat();} else {doTheOther();} – Logical operators &&, ||, ! – Bouncing ball programme

Lecture 3: Loops and Functions Loops – while(condition) { doThis(); change something; } – int x = constrain(value, min, max); – for (initialization; test; change something) { doThis(); } – Increment expressions i++, i--, i += 2, i -= 2 – Scope – Loops within loops Functions – Modularity and reusability – ReturnType functionName(ArgType1 arg1, ArgType2 arg2) { ReturnType r = something; doSomethingWithR(); return r; }

Lecture 4: Objects and Arrays Objects – Data and functions together – Instance variables and methods – Classes as templates for making objects – Dot notation for messages myCar.move(); int s = myCar.speed; – Writing a class class ClassName { int x; float y; ClassName(int x, float y) { this.x = x; this.y = y; } void display() { //Use x and y to show this object …. } } – Class definitions must appear outside of setup() or draw() – Putting a class in its own tab Arrays – Array is a list of boxes, all holding values of the same type – Declaring an array variable int[] arrayOfInts; – Creating an array int[] arrayOfInts = new int[10]; – Accessing an element in an array arrayOfInts[0] = 5; int x = arrayOfInts[0]; – Initializing all elements at once int[] intArray = {5,4,3,2,1}; – Initializing an array with a loop for (int i = 0; i < intArray.length; i++) intArray[i] = 2 * i; – Array functions shorten(), concat(), subset(), etc.