What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.

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

Lesson One: The Beginning
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/13/08.
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
Processing Lecture. 1 What is processing?
Variables and Operators
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
CSC 123 – Computational Art Introduction to Shape and composition
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
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.
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.
Beech Hall School Computing Science Course. To learn how to design and create a software application – an App Learn the basics of App Design Learn the.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 1 Introduction to Processing.
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.
Environment. The toolbar buttons allow you to run and stop programs, create new sketches, open, save and export: 1.Run. Compiles the code, opens a display.
Week 2 Book Chapter 1 RGB Color codes. 2 2.Additive Color Mixing RGB The mixing of “ light ” Primary: Red, Green, Blue The complementary color “ White.
Coding: Games, Apps and the Arts Unit 0: Processing Basics 1.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Continuous February 16, Test Review What expression represents the zip car eligibility rules of at least 18 years old and no incidents?
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
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
CIS 3.5 Lecture 2.2 More programming with "Processing"
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
1 Taif University Faculty Of Computers And Information Technology TA. Kholood Alharthi & TA. Maha Thafar First Semester AH.
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Mouse Inputs in Processing. Interacting with the Mouse mouseX and mouseY: pg mouseXmouseY –The position of the mouse in the canvas pmouseX and.
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 Looping. User input. Classwork/Homework: Incorporate looping & user input into a sketch.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
Graphics Primitives in Processing 1/14/2010. size(x, y) ; Sets the initial size of the screen Units are in pixels –Pixel == picture element –Small dots.
B. RAMAMURTHY Processing and Programming cse
Vertices, Curves, Color, Images mostly without details 02/16/2010.
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.
Welcome to Processing Who does not have access to digital camera?
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
Introduction to Processing Dominique Thiebaut Dept. Computer Science Computer Science Dominique Thiebaut Thiebaut -- Computer Science.
Computer Science I Go over midterm. Reprise on curves. Table examples. The map function. Testing Strings. Fonts. Classwork/Homework: Complete midterm project.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/20/08.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
PROCESSING A computer screen is a grid of small light elements called pixels.
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
Task 1 and Task 2. Variables in Java Programs Variables start with lower case letter Variables are descriptive of what they store Variables are one word.
Basic Input and Output CSE 120 Spring 2017
Chapter 14, Translate & Rotate
Basic Input and Output CSE 120 Winter 2018
Mouse Inputs in Processing
More programming with "Processing"
IAT 265 Lecture 2: Java Loops, Arrays Processing setup, draw, mouse Shapes Transformations, Push/Pop.
Basic Input and Output CSE 120 Winter 2019
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
LCC 6310 Computation as an Expressive Medium
Processing Environment
Lets shape up! Pages:
Continuous & Random September 21, 2009.
Lets shape up! Pages:
Presentation transcript:

What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad – rect – ellipse Processing Canvas Coordinate System Shape Formatting – Colors – Stroke – Fill Review

random(high); random(low, high); Generate a random number in the range low (or 0) to high mouseX mouseY Built-in predefined variables that hold the current mouse X and Y locations print( something ); println( something ); Print something to the Processing console.

void setup() { // Called once when program starts } void draw() { /* Called repeatedly while program runs */ }

randomEllipse void setup() { size(300, 300); smooth(); } void draw() { fill(random(255), random(255), random(255)); ellipse(mouseX, mouseY, 30, 30); }

Controlling the draw loop frameRate(fps); Sets number of frames displayed per second. i.e. the number of times draw() is called per second. Default = 60. noLoop(); Stops continuously calling draw(). loop(); Resumes calling draw().

More Graphics arc(…) curve (…) bézier(…) shape(…)

Arcs An arc is a section of an ellipse x, y, width, height location and size of the ellipse start, stop arc bounding angles (in radians) arc( x, y, width, height, start, stop );

Arcs

Spline Curves Spline: A smooth line drawn through a series of points A curve is a Catmull-Rom (cubic Hermite) spline defined by four points x2, y2 and x3, y3 beginning/end points of visual part of curve x1, y1 and x4, y4 control points that define curve curvature curve( x1, y1, x2, y2, x3, y3, x4, y4 );

Spline Curves

Bézier Curves A smooth curve defined by two anchor points and two control points x2, y2 and x2, y2 anchor points of bézier curve cx1, cy1 and cx2, cy2 control points that define curvature bezier( x1, y1, cx1, cy1, cx2, cy2, x2, y2 );

Bézier Curves

Custom Shapes Composed of a series of vertexes (points) Vertexes may or may not be connected with lines Lines may join at vertexes in a variety of manners Lines may be straight, curves, or bézier splines Shape may be closed or open

Custom Shapes beginShape( [option] ); vertex( x, y ); curveVertex( x, y ); bezierVertex( cx1, cy1, cx2, cy2, x, y ); endShape( [CLOSE] );

beginShape(); vertex(30, 20); vertex(85, 20); vertex(85, 75); vertex(30, 75); endShape(CLOSE); noFill(); beginShape(); vertex(30, 20); vertex(85, 20); vertex(85, 75); vertex(30, 75); endShape(CLOSE); beginShape(QUADS); vertex(30, 20); vertex(30, 75); vertex(50, 75); vertex(50, 20); vertex(65, 20); vertex(65, 75); vertex(85, 75); vertex(85, 20); endShape(); beginShape(); vertex(20, 20); vertex(40, 20); vertex(40, 40); vertex(60, 40); vertex(60, 60); vertex(20, 60); endShape(CLOSE); beginShape(QUAD_STRIP); vertex(30, 20); vertex(30, 75); vertex(50, 20); vertex(50, 75); vertex(65, 20); vertex(65, 75); vertex(85, 20); vertex(85, 75); endShape(); beginShape(TRIANGLE_FAN); vertex(57.5, 50); vertex(57.5, 15); vertex(92, 50); vertex(57.5, 85); vertex(22, 50); vertex(57.5, 15); endShape(); beginShape(TRIANGLES); vertex(30, 75); vertex(40, 20); vertex(50, 75); vertex(60, 20); vertex(70, 75); vertex(80, 20); endShape(); beginShape(TRIANGLE_STRIP); vertex(30, 75); vertex(40, 20); vertex(50, 75); vertex(60, 20); vertex(70, 75); vertex(80, 20); vertex(90, 75); endShape(); noFill(); beginShape(); vertex(30, 20); vertex(85, 20); vertex(85, 75); vertex(30, 75); endShape(); beginShape(POINTS); vertex(30, 20); vertex(85, 20); vertex(85, 75); vertex(30, 75); endShape(); beginShape(LINES); vertex(30, 20); vertex(85, 20); vertex(85, 75); vertex(30, 75); endShape();

strokeJoin() noFill(); smooth(); strokeWeight(10.0); strokeJoin(MITER); beginShape(); vertex(35, 20); vertex(65, 50); vertex(35, 80); endShape(); noFill(); smooth(); strokeWeight(10.0); strokeJoin(BEVEL); beginShape(); vertex(35, 20); vertex(65, 50); vertex(35, 80); endShape(); noFill(); smooth(); strokeWeight(10.0); strokeJoin(ROUND); beginShape(); vertex(35, 20); vertex(65, 50); vertex(35, 80); endShape();

More Color colorMode(RGB or HSB); RGB: (red, green, blue) HSB: hue “pure color” saturation “intensity” brightness “lightness”

Decimal vs. Binary vs. Hexadecimal DecimalHexBinary A B C D E F

Example Sketches... – LadyBug1 – Monster1 – Ndebele – Penguin1 – SouthParkCharacter1 – Sushi – GiorgioMorandi

OpenProcessing – Bryn Mawr and SMU student sketches

void mousePressed() { // Called when the mouse is pressed } void mouseReleased() { // Called when the mouse is released } void mouseClicked() { // Called when the mouse is pressed and released // at the same mouse position } void mouseMoved() { // Called while the mouse is being moved // with the mouse button released } void mouseDragged() { // Called while the mouse is being moved // with the mouse button pressed }

void keyPressed() { // Called each time a key is pressed } void keyReleased() { // Called each time a key is released } void keyTyped() { // Called when a key is pressed // Called repeatedly if the key is held down }

keyCode vs. key key – A built-in variable that holds the character that was just typed at the keyboard keyCode – A built-in variable that hold the code for the keyboard key that was touched All built-in keyboard interaction functions … Set keyCode to the integer that codes for the keyboard key Set key to the character typed All keyboard keys have a keyCode value Not all have a key value

ASCII - American Standard Code for Information Interchange !"#$%&' 40()*+,-./ :; 70FGHIJKLMNO 80PQRSTUVWXY 90Z[\]^_`abc 100defghijklm 110nopqrstuvw 120xyz{|}~ € 130 ‚ƒ„…†‡ˆ‰Š‹ 140 Œ Ž ‘’“” 150 –—˜™š›œ ž Ÿ 160 ¡¢£¤¥¦ §¨ © 170 ª«¬­®¯ °± ²³ 180´ µ ¶ ·¸¹º»¼½ 190 ¾¿ÀÁ Âà ÄÅÆÇ 200 ÈÉ Ê Ë Ì ÍÎÏ Ð Ñ 210Ò Ó ÔÕ Ö × ØÙÚÛ 220 Ü ÝÞ ßàá âã äå 230 æçèé ê ëìíîï 240ð ñ ò ó ôõ ö ÷ øù 250 úûü ýþ ÿ