Processing Variables. Variables Processing gives us several variables to play with These variables are always being updated and you can assume they have.

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

Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
A Quick Introduction to Processing
Recursion October 5, Reading Read pp in the text.
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
 Variables  What are they?  Declaring and initializing variables  Common uses for variables  Variables you get “for free” in Processing ▪ Aka: Built-in.
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.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
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.
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
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
By. Circle Draw a circle in the box Tell about its attributes: sides, angles, whether or not it’s a polygon. Add any additional information you know about.
B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
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"
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.
Lesson Two: Everything You Need to Know
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 More details and explanation …
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
Set-up a Data Entry Page Section 3. Set Up Columns Switch to Variable View. At the bottom left of your screen there are two tabs (Data View and Variable.
Computer Science I Looping. User input. Classwork/Homework: Incorporate looping & user input into a sketch.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
B. RAMAMURTHY Processing and Programming cse
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?
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
IAT 265 Images in Processing PImage. Jun 27, 2014IAT 2652 Outline  Programming concepts –Classes –PImage –PFont.
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.
Topic 3 Exponents.  Each group is responsible a block of problems  Find the answers  Draw the matching picture on the poster.  If you notice a mistake.
Coding – Week 2 Functions, Arrays, and Objects. Functions  Functions are not a new concept – you’ve been using them already.  void setup() {} and void.
Unit J Review. Simplify – assume all variables are positive.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
Functions. 2 Modularity What is a function? A named block of code Sometimes called a ‘module’, ‘method’ or a ‘procedure’ Some examples that you know are:
Conic Sections Practice. Find the equation of the conic section using the given information.
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.
Surface area of a cylinder Imagine a cylinder opened out Rectangle Circle.
Chapter 14, Translate & Rotate
“Processing” easy coding Jens Dalsgaard Nielsen
Introduction to Object-Oriented Programming
Section 12.2 Implicitly Defined Curves and Cicles
Mouse Inputs in Processing
Chapter 5, Conditionals Brief Notes
Extend Text Editor to Draw shapes
A Few Notes Starting August 29, 2018
A Few Notes August 30, 2017.
Lecture 7: Introduction to Processing
Inheritance in Graphics
2 types of scale factor problems
Warm-Up #8 (Monday, 9/21/15) Mary has a box that has a length of 1, a width of 1.2, and a height of What is the volume of Mary’s box? Peter has.
Exponents and Exponential Form
Chapter 13, Math A few Examples.
Spell your name using word art from above
This is a square. This is a square. How can you tell. How can you tell
Presentation transcript:

Processing Variables

Variables Processing gives us several variables to play with These variables are always being updated and you can assume they have the right value Watch your spelling!

Mouse Location mouseX tells the X location of the mouse mouseY tells the Y location of the mouse

Window Properties width tells the width of the window currently (even if you resize) height tells the current height of the window height width

What can you do with that? Draw a circle that follows the mouse: ellipse(mouseX, mouseY, 20, 20); Draw a rectangle (60x40) centered around the mouse: rect(mouseX-30, mouseY-20, 60,40); Draw a box, centered, exactly ½ the size of the window: rectMode(CENTER); rect(width/2, height/2, width/2, height/2);

Coding with methods Notice the “chunks” of code, like setup and draw: public void draw(){ <- Code goes in here. }

Coding with methods Notice the “chunks” of code, like setup and draw: public void draw(){ <- Code goes in here. } We can make our own: public void drawEyes(){ ellipse(50,50,10,10); ellipse(20,50,10,10); }

Coding with methods Notice the “chunks” of code, like setup and draw: public void draw(){ drawEyes();Now call the method in }the draw() section. We can make our own: public void drawEyes(){ ellipse(50,50,10,10); ellipse(20,50,10,10); }