Introduction to Programming

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
Processing the Danger Shield Everything you wanted to know about Processing but were afraid to ask By Ben Leduc-Mills.
Mouse Listeners We continue our examination of GUIs by looking at how to interact with the mouse –Just as Java creates Events when the user interacts with.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
Introduction to shapes
A Quick Introduction to Processing
Processing Lecture. 1 What is processing?
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
Grundaufbau import processing.core.PApplet; public class Proc_Minimal extends PApplet { public void setup(){ size(1024, 768); frameRate(60.0f);
 By carefully incrementing the X and/or Y values of our set of lines, we can create a game board for a boat game.  Lines that go from left to right are.
Color by Numbers Pages Syntax Introduced color color() colorMode()
Color by Numbers Pages (Skipped Curves 79-84)
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.
PROCESSING Animation. Objectives Be able to create Processing animations Be able to create interactive Processing programs.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Co mputer Graphics Researched via: Student Name: Nathalie Gresseau Date:12/O7/1O.
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.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Chapter 11 Java AWT Part I: Mouse Events (Optional) Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin,
Introduction to Flash. Topics What is Flash? What can you do with it? Simple animation Complex interactive web application, such as an online store. Starting.
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] |
Computer Images Can store color info about each pixel, but makes file BIG Compression for Web 15.
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.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. Chapter 9 GUI Programming Using Tkinter 1.
Some Graphics CS303E: Elements of Computers and Programming.
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.
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
Do Now: Take out your notebook and a pen. Good Morning Do Now: Take out your notebook and a pen. Good Morning Aim: What is color? Mr. Spaterella Technology.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 2 More Programming with Processing.
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.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
B. RAMAMURTHY Processing and Programming cse
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
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.
CSC1401 Drawing in Java - 1. Goals Understand at a conceptual and practical level How to use the Turtle class to draw on a picture How to use the java.awt.Graphics.
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.
Introduction to Illustrator
Processing Introduction CSE 120 Spring 2017
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Microsoft® Small Basic
Basic Graphics Drawing Shapes 1.
Processing and Drawing CSE 120 Winter 2018
بسم الله الرحمن الرحیم مركز بهمن استاندارد- مديريت ارزيابي و مانيتورينگ كيفي.
Click to play with audio
Exam1 Review CSE113 B.Ramamurthy 11/29/2018 B.Ramamurthy.
Mouse Inputs in Processing
Fractions 1/2 1/8 1/3 6/8 3/4.
More programming with "Processing"
What Color is it?.
Processing and Drawing CSE 120 Winter 2019
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Processing Environment
TITLE BYOT Half Circle (Advanced)
Presentation transcript:

Introduction to Programming With Computer Language Processing

Processing Born in 2001 at MIT. Open source. Language and environment to program images, animation, and sounds. Build on Java. www.processing.org

Processing Based on Java. Case sensitive Statement terminates by ; Three major components: Fundamentals: data types, variables, operators… Control structs: Functions Decisions: if Loops: while, for Data structures: Class and objects Many examples

Processing Interactions: Libraries and references: Mouse operations: move, click… No buttons, labels... Use Java to add them Libraries and references: Use Help Go to www.processing.org

Data Representations in a Computer Computer understands only 0’s and 1’s. Text file: ASCII file  numbers Binary file: all numbers Images and graphics: every pixel has a number representing Grayscale (0 – 255) Color (red: 0-255, green: 0-255, blue: 0-255) Optional: alpha (0-255), color transparency.

Grayscale: black  white

Three basic colors can generate Red + Green = Yellow Red + Blue = Purple Green + Blue = Cyan (blue-green) Red + Green + Blue = White no colors = Black Three basic colors can generate all colors

Pixels and Coordinates Pixel: unit of image resolution Coordinate system: Top-left corner: (0,0) X axis: horizontal axis, left to right Y axis: Vertical, top to buttom Point: (X-coordinate, Y-coordinate) Examples: Point (0,0), (2,5), (3,3)…

Graphical Shapes: Line Two points determines a line: p1(x1,x2) and p2(x2,y2) Function to draw a line Line(x1,y1,x2,y2);

Graphical Shapes: Rect Three modes: CORNER, CENTER, CORNERS. Default: CORNER CORNER: rectMode(CORNER); rect(x1,y1,w,h); //x1,y1: top-left corner CENTER: rectMode(CENTER); rect(x,y,w,h); //x,y: center CORNERS: rectMode(CORNERS); rect(x1,y1,x2,y2); //x1,y1,x2,y2: top-left and button right coners

Graphical Shapes: Ellipse Three modes: CORNER, CENTER, CORNERS. Default: CENTER CORNER: ellipseMode(CORNER); ellipse(x1,y1,w,h); //x1,y1: top-left corner CENTER: ellipseMode(CENTER); ellipse(x,y,w,h); //x,y: center coord. CORNERS: ellipseMode(CORNERS); ellipse(x1,y1,x2,y2); //x1,y1,x2,y2: top-left and button right coners

Graphical Shapes: Exercises Draw a circle Draw a triangle using function triangle function line Draw an angle Draw a quad using function quad

Graphical Contents stroke(color); fill(color); noStroke(); noFill(); strokeWeight(int); background(color);

Important System Variables mouseX, mouseY: current x,y coordinates of the mouse pmouseX, pmouseY: previous x,y coordinates of the mouse

Important Interactive Functions mouseMoved(); mouseDragged(); mouseClicked(); mousePressed(); mouseReleased(); keyPressed();