Processing Introduction CSE 120 Spring 2017

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning
Advertisements

Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/13/08.
Introduction to Programming
Processing Lecture. 1 What is processing?
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
Color by Numbers Pages Syntax Introduced color color() colorMode()
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
Aim: Use the given examples to record examples and our own ideas in our journal 1.Write technical examples in journal and/or participate in full.
LCC 6310 Computation as an Expressive Medium Lecture 1.
This presentation will cover your LCD screen with several solid colors, one at a time. This makes it fairly easy to see stuck (always on or off) pixels.
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.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
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.
Processing Workshop. What is processing? “Processing is an open source programming language and environment for people who want to program images, animation,
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
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,
CS 112 Introduction to Programming Java Graphics Yang (Richard) Yang Computer Science Department Yale University 208A Watson, Phone:
CompSci 4 Java 4 Apr 14, 2009 Prof. Susan Rodger.
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
Nested Loops & Arrays CSE 120 Spring 2017
Expressions & Control Flow CSE 120 Spring 2017
Pixels, Colors and Shapes
4.01 Cascading Style Sheets
Basic Input and Output CSE 120 Spring 2017
Developing an App CSE 120 Spring 2017
Functions in Processing CSE 120 Spring 2017
Building Java Programs
Lightbot and Functions CSE 120 Winter 2017
Building Java Programs
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Microsoft® Small Basic
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
Basic Input and Output CSE 120 Winter 2018
Variables & Datatypes CSE 120 Winter 2018
Colors.
Processing and Drawing CSE 120 Winter 2018
Expressions & Control Flow CSE 120 Winter 2018
4.14 GUI and Graphics Case Study: Creating Simple Drawings (Cont.)
Binary Numbers CSE 120 Spring 2017
Topic 8 graphics "What makes the situation worse is that the highest level CS course I've ever taken is cs4, and quotes from the graphics group startup.
Building Java Programs
Developing an App II CSE 120 Spring 2017
Variables & Datatypes CSE 120 Spring 2017
SSEA Computer Science: Track A
Lightbot and Functions CSE 120 Winter 2018
CSE 113 A January 26 – 30, 2009.
Chapter 2 Graphics Programming with C++ and the Dark GDK Library
What employers and colleges expect you to have.
CSE 142 Lecture Notes Graphics with DrawingPanel Chapter 3
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
January 26 – 30, 2009 CSE 113 B.
Basic Input and Output CSE 120 Winter 2019
Variables & Datatypes CSE 120 Winter 2019
Lawrence Snyder University of Washington, Seattle
Processing and Drawing CSE 120 Winter 2019
Loops & Nested Loops CSE 120 Winter 2019
Processing Environment
Announcements How to save your work? Quiz solution 5/5/2019
Buttons & Boards CSE 120 Winter 2019
Basic Processing … Drawing pictures … It’s not art, it’s fun
Chapter 1 Introducing Small Basic
4.01 Cascading Style Sheets
LCC 6310 Computation as an Expressive Medium
JavaScript – Let’s Draw!
Presentation transcript:

Processing Introduction CSE 120 Spring 2017 Instructor: Teaching Assistants: Justin Hsia Anupam Gupta, Braydon Hall, Eugene Oh, Savanna Yee 69 New Emojis Announced, Including Breastfeeding Woman, Woman with Headscarf, and Steak The newest emoji update may be the most inclusive yet, featuring a woman wearing a head covering, a breastfeeding woman, and also both steak and broccoli. These are just a few of the 69 individual symbols with varying skin tone and gender offered in shadowy technology organization the Unicode Consortium's 10th update, which includes Emoji 5.0. There will also be dinosaurs, dumplings, cussing, and hedgehogs. Oh, and this barfing emoji: https://creators.vice.com/en_us/article/69-new-emojis- breastfeeding-woman-headscarf-steak

Administrivia Assignments: No “big ideas” lecture this week Lightbot Functions due today (4/3) Building a Robot due tomorrow (4/4) Taijitu due Wednesday (4/5) No “big ideas” lecture this week More time on programming

Processing Our programming language for this course Text-based language that is good for visuals and interaction Try to focus on ideas and techniques, not the specific commands No language is perfect – Processing has its fair share of quirks and deficiencies ☹ It is both a programming environment (where you type) and a programming language You are writing Java code, but they have made a lot of things easier

What You See

Interactive Line Drawing

Line Drawing Code semi-colon indicates end of statement case-sensitive mouseX ≠ mousex There is color coding Other helpful environment features: Parentheses matching Error messages

Comments Are Critical!!!

The Processing Reference

Understanding Color In electronic systems, color specified using the RGB color model Red, Green, Blue Each pixel on your screen is made up of 3 tiny lights, one red, one green, one blue Specify the intensity of each light using an integer between 0 and 255 0 is completely off 255 is highest intensity

Processing’s Color Selector

Guess the Color color( R, G, B); color(255, 0, 0); color( 0, 255, 0);

Guess the Color color( R, G, B); color(255, 0, 0); // R fully on color( 0, 255, 0); // G fully on color( 0, 0, 255); // B fully on color( 0, 0, 0); // all off color(255, 255, 255); // all fully on color(255, 255, 0); // R,G fully on color(255, 0, 255); // R,B fully on color( 0, 255, 255); // G,B fully on

Guess the Color color( R, G, B); color(255, 0, 0); // red color( 0, 255, 0); // green color( 0, 0, 255); // blue color( 0, 0, 0); // black color(255, 255, 255); // white color(255, 255, 0); // yellow color(255, 0, 255); // magenta color( 0, 255, 255); // cyan

Color Functions background(R, G, B); Sets the background color of the drawing canvas

Color Functions stroke(R, G, B); Sets the color of the stroke of a line or line around a shape Can change line size using strokeWeight(#);

Color Functions fill(R, G, B); Sets the inside color of a shape (note: you cannot fill a line)

Color: “Grays" When the values for RGB are all the same, then the color will be white, black, or some shade of gray

Color: “Grays" When the values for RGB are all the same, then the color will be white, black, or some shade of gray For brevity, can specify just a single number instead

The Color “State” of Your Program Recall that programs are executed sequentially (i.e. instruction-by-instruction) background(), stroke(), and fill() apply to all subsequent drawing statements Until a later call overrides Hidden color “state” that knows the current values of background(), stroke(), and fill() In complex programs, can be difficult to keep track of Early rule of thumb: always explicitly set colors before each drawing element

Assignment: Coloring a Robot

Coordinate System

Drawing: Line

Drawing: Rectangle Default mode is CORNER In CORNER: rect( x, y, width, height );

Drawing: Additional Rect Modes CENTER CORNERS In CENTER: rect( x, y, width, height ); In CORNERS: rect( x1, y1, x2, y2 );

Drawing: Ellipse/Circle Default mode is CENTER In CENTER: ellipse( x, y, width, height );

Drawing: Additional Ellipse Modes CORNER CORNERS In CORNER: ellipse( x, y, width, height ); In CORNERS: ellipse( x1, y1, x2, y2 );

Peer Instruction Question Which of the following drawings corresponds to the Processing code below? Vote at http://PollEv.com/justinh strokeWeight(10); stroke(75, 47, 131); // UW purple fill(183, 165, 122); // UW gold ellipse(100, 100, 100, 200); // CENTER mode A. B. C. D.

Lab: Taijitu How do you build a complex drawing out of these simple shapes?

Aside: Processing Files Processing files have extension .pde File names cannot contain dashes (-) To run a Processing file, it must be in a folder of the same name If it’s not, then Processing will create the folder for you