B. RAMAMURTHY Processing and Programming cse113-2013-2 1.

Slides:



Advertisements
Similar presentations
Physical Computing INST. Kerem Odabaşı - YTU - Interactive Telecomunication Design Dept.
Advertisements

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.
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.
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
A Quick Introduction to Processing
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.
IAT 334 Lab 2 Computer Graphics: Rocket, PImage. June 4, 2010IAT 3342 Outline  Programming concepts –Programming Computer Graphics –Transformations –Methods.
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.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Classes / Objects An introduction to object-oriented programming.
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,
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Barclays Mobile Robotics Hour 1 Overview Session.
B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is.
PImage. Let’s look at the PImage class in ProcessingPImage –What are the fields (i.e., variables)? –What methods are available? –What about the constructor---how.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
B. RAMAMURTHY Simulating Motion and Implementing Animation.
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.
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 …
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
Welcome back!. Object Oriented Programming – Encapsulation Classes encapsulate state (fields) and behavior (methods) – Polymorphism Signature Polymorphism.
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.
Processing TYWu. Where can I download? 2.0b9 Windows 32-bit.
IAT 265 Images in Processing PImage. Jun 27, 2014IAT 2652 Outline  Programming concepts –Classes –PImage –PFont.
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
Processing Variables. Variables Processing gives us several variables to play with These variables are always being updated and you can assume they have.
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
IAT 800 Lecture 8 PImage and PFont. Oct 13, Fall 2009IAT 8002 Outline  Programming concepts –PImage –PFont.
B. RAMAMURTHY Lab1 Discussion. General Instructions Attend the recitation (s), office hours (s) to get help Read the Lab description Understand what is.
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.
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:
10/20/2005week71 Graphics, mouse and mouse motion events, KeyEvent Agenda Classes in AWT for graphics Example java programs –Graphics –Mouse events –Mouse.
David Meredith Aalborg University
Emerging Platform#1: Processing 3
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Computation as an Expressive Medium
Code Elements and Processing Coordinate System
For Net Art Lecture 2 J Parker
Exam1 Review CSE113 B.Ramamurthy 11/29/2018 B.Ramamurthy.
Mouse Inputs in Processing
Chapter 5, Conditionals Brief Notes
More programming with "Processing"
Code Elements and Processing Coordinate System
Lawrence Snyder University of Washington, Seattle
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
LCC 6310 Computation as an Expressive Medium
Lab1 Discussion B. Ramamurthy.
Spell your name using word art from above
Presentation transcript:

B. RAMAMURTHY Processing and Programming cse

Topics cse Lets understand some of the processing primitives “commands” or “instructions” Format of commands Grouping of commands into coherent functions Parameterizing the commands Sample commands: lets learn some commands

Program in Processing cse A program in Processing language is a collection of one or more commands Format of a command: Keyword Parenthesis Arguments or parameters Semicolon terminating the command Example: size(400,400);

List of all commands cse Reference to all the Processing commands is available at It is also available in the Help menu of your Processing environment

A simple program (House) cse size(400, 600); rect(50,250,300,300); triangle(50,250,350,250,200,50); rect(175,450,50,100); ellipse(185,515,6,6); rect(85,300,40,40); rect(130,300,40,40); rect(85,340,40,40); rect(130,345,40,40); rect(230,300,40,40); rect(275,300,40,40); rect(230,345,40,40); rect(275,345,40,40); ellipse(20,20,30,30);

Lets Organize it cse A program as a collection of functions/methods void setup() { size(1400,1400); stroke(0); } void draw() { line(40,50, mouseX, mouseY); } void mousePressed() { background(192,64,0); stroke(255); PImage img= loadImage("Penguins.jpg"); image(img,0,0); }

Lets learn some commands: 2D commands cse point (x, y); line(x1,y2,x2,y2); triangle(x1,y1, x2,y2, x3,y3); rect(x,y, length, width); // when length = width we get square ellipse(x, y, width, height); //when width=height we get circle arc(x,y,width, height, start, stop); quad(x1,y1, x2, y2, x3, y3, x4,y4);

Color commands cse background(single color #);// # between background(r, g, b); // complex color background(img); fill(color); // sets fill color in RGB stroke(color);//sets the line color

Mouse Button cse mouseX mouseY mousePressed mouseReleased() mouseMoved() mouseDragged()