Processing and Drawing CSE 120 Winter 2018

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.
IAT 800 Foundations of Computational Art and Design ______________________________________________________________________________________ SCHOOL OF INTERACTIVE.
LCC 6310 Computation as an Expressive Medium Lecture 1.
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.
PROCESSING & JAVA An Introduction to Computing. Objectives Be able to state and apply phases of development Be able to state and describe the goals of.
CSE 219 Computer Science III Images. HW1 Has been posted on Blackboard Making a Game of Life with limited options.
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 5 Working with Images Starting Out with Games & Graphics in.
Computer Science 112 Fundamentals of Programming II Graphics Programming.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 2 Graphics Programming with C++ and the Dark GDK Library Starting.
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.
Often being different. Control flow By default Java (and therefore Processing) executes lines of a program one after the other –Doesn’t matter what happened.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
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
Pixels, Colors and Shapes
Basic Input and Output CSE 120 Spring 2017
Processing Introduction CSE 120 Spring 2017
Functions in Processing CSE 120 Spring 2017
Building Java Programs
Lightbot and Functions CSE 120 Winter 2017
Building Java Programs
Building Java Programs
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Algorithmic Complexity CSE 120 Winter 2018
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Mid-Quarter Review CSE 120 Winter 2018
Functions in Processing CSE 120 Winter 2018
Learning to program with Logo
Basic Graphics Drawing Shapes 1.
Puzzle App II CSE 120 Winter 2018
Basic Input and Output CSE 120 Winter 2018
Variables & Datatypes 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
Variables & Datatypes CSE 120 Spring 2017
SSEA Computer Science: Track A
Lightbot and Functions CSE 120 Winter 2018
Strings, Puzzle App I CSE 120 Winter 2018
Chapter 2 Graphics Programming with C++ and the Dark GDK Library
Nested Loops, Arrays CSE 120 Winter 2018
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
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
Buttons & Boards CSE 120 Winter 2019
Basic Processing … Drawing pictures … It’s not art, it’s fun
Chapter 1 Introducing Small Basic
LCC 6310 Computation as an Expressive Medium
JavaScript – Let’s Draw!
Presentation transcript:

Processing and Drawing CSE 120 Winter 2018 Instructor: Teaching Assistants: Justin Hsia Anupam Gupta, Cheng Ni, Eugene Oh, Sam Wolfson, Sophie Tian, Teagan Horkan The World Health Organization Identifies Gaming Disorder as a Mental Health Condition “The WHO’s impending beta draft… classifies gaming disorder as a pattern of behavior with ‘impaired control over gaming,’ in terms of its frequency, intensity, duration, and the capacity to quit. The disorder… is characterized by giving increased priority to gaming over other daily activities. “The WHO’s decision highlights a schism among psychologists: some think the new designation is a welcome one, but others don’t see enough evidence to justify it. “As our video game experience expands with virtual reality (VR) and augmented reality (AR), the argument gets even murkier.” https://futurism.com/world-health-organization-identifies-gaming- disorder-mental-health-condition/

Administrivia Assignments: First “big ideas” lecture this week: Binary Lightbot Functions [hw] due today before 11:59 pm (1/8) Taijitu [lab] due before lab on Thursday (1/11) First “big ideas” lecture this week: Binary Reading due before lab on Thursday (1/11) Brief discussion in lab on Thursday

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

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

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); // 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); Covers the entire drawing canvas with the specified color Will draw over anything that was previously drawn

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) stroke() and fill() apply to all subsequent drawing statements Until a later call overrides Hidden color “state” that knows the current values of stroke(), strokeWeight(), and fill() In complex programs, can be difficult to keep track of Early rule of thumb: always explicitly set colors before each drawing element

Coordinate System x y

Drawing: Line

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

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

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); A. B. C. D.

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