Basic Processing … Drawing pictures … It’s not art, it’s fun

Slides:



Advertisements
Similar presentations
Processing Lecture. 1 What is processing?
Advertisements

Go through this show in OpenOffice Impress by using the right scrollbar or clicking individual slide thumbnails on the left side. This hands-on demo is.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Changing Control.
CS320n – Elements of Visual Programming Introduction to Alice Mike Scott (Slides 1-1)
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.
HTML Lesson 2 TBE 540 Farah Fisher. Prerequisites Access web pages and navigate Use search engines to locate specific information Download graphics from.
A Simple Applet. Applets and applications An applet is a Java program that runs on a web page –Applets can be run from: Internet Explorer Netscape Navigator.
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
A Simple Applet.
Introduction to Shape Programming When we make geometric shapes with computers, we have to give specific numbers to tell the computer exactly what to do.
LCC 6310 Computation as an Expressive Medium Lecture 1.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 “Digits” does not refer only to your 10 fingers…
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
1 Web Developer Foundations: Using XHTML Chapter 4 Key Concepts.
Applying Color in CSS Web Design – Sec 4-5 Part or all of this lesson was adapted from the University of Washington’s “ Web Design & Development I ” Course.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Week 1 – Beginners Content McAfee & Big Fish Games CoderDojo.
Graphics. Graphic is the important media used to show the appearance of integrative media applications. According to DBP dictionary, graphics mean drawing.
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.
Lecture 7: Intro to Computer Graphics. Remember…… DIGITAL - Digital means discrete. DIGITAL - Digital means discrete. Digital representation is comprised.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 More details and explanation …
 Functions package up computation … when do we use them? All the time.  Write some simple code to achieve a goal … 12/20/2015© 2010 Larry Snyder, CSE1.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Drawing pictures … It’s not art, it’s fun.
1 A Simple Applet. 2 Applets and applications An applet is a Java program that runs on a web page Applets can be run within any modern browser To run.
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
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,
Card Design How to Mrs Ras. Open Illustrator File>New.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
Scientific Notation. = 5.4 =3.47 Write the following in standard form A 1.8 X 10⁴ B 3.47 X 10⁷ C 4.3 X 10⁰ D 5.4 X 10⁻⁴ E 5 X 10⁻⁶ F (6 X 10⁴) (7 X 10⁵)
Creating Web Pages in Word. Sharing Office Files Online Many Web pages are created using the HTML programming language. Web page editors are software.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
AP CSP: Pixelation – B&W/Color Images
Announcements After Image Survey … Assignments today, and next week …
Binary Notation and Intro to Computer Graphics
11 October Building a Web Site.
Processing Introduction CSE 120 Spring 2017
UNIT 2 – LESSON 4 Encoding Color Images.
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
LET’S LEARN ABOUT GRAPHICS!
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Learning to program with Logo
Processing and Drawing CSE 120 Winter 2018
To do … Web Exercise: Quiz-3, HW#2 Score: update
Color Values All colors in computer images are a combination of red, green and blue Each component is encoded as a number means the color is.
Announcements Library link and the anonymous Panic button
A few tricks to take you beyond the basics of Microsoft Office
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
Light Bot Solutions: an analysis
Light Bot Solutions: an analysis
Announcement Function ppt: download again
Art Programs Raise Deep Questions
Announcements How’s it going? My internet/power supply?
Testing and Repetition
Announcements: Reading materials are posted on Discussion Board.
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Colors Computers build colors from Red, Green, and Blue; not Red, Blue, and Yellow. RGB = Red Green Blue Creating Colors Red + Blue = Purple No Red, No.
Using the Power of XML Personally
Variables, Assignments Testing + Iteration
Lawrence Snyder University of Washington, Seattle
Digitization & Processing
Processing and Drawing CSE 120 Winter 2019
Announcements How to save your work? Quiz solution 5/5/2019
Announcements: Questions: Names on the board? Why?
Chapter 1 Introducing Small Basic
Announcements Survey feedback: summary Quiz: HW 7:
Today: to list: Syllabus change: Grade on-line
Announcements Jack group member by Thursday!! Quiz-8? HW10
Presentation transcript:

Basic Processing … Drawing pictures … It’s not art, it’s fun Kelvin Sung University of Washington, Bothell (* Use/Modification with permission based on Larry Snyder’s CSE120 ) © Lawrence Snyder 2004

Review from Last Time … Digital information can be processed by machines Since Hollerith digitized census data in 1890 we’ve come a long way: computers, transistors and integrated circuits, PCs, Internet, WWW, and … each had a huge effect 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Processing … It’s our main programming language “Processing” is kind of a dumb name, but it is a good (and fun) language It’s a language for programming graphical and image-based computations More fun than programming an operating system Easier to do because we “see” what’s happening 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Short Interrupt: Grab Processing If you have a personal computer that is convenient to do homework on, then grab a copy of the Processing system and put it on your machine … improve your convenience! Grab it at: http://processing.org/download/ You will want “Windows” or “Mac” versions Following installation instructions … it takes less than 5 minutes and then you can work on your own computer! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

What You See When you start up the Processing system… Run New Save Stop Open Export file name programming window 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Add Some Code Type in instructions that you will learn shortly Then run your program 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Looking At Simpler Code Drawing a snow angel is straightforward … 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Looking At Simpler Code Drawing a snow angel is straightforward … Demo of code here Just Do It! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Coding Is ALL Detail Notice everything!  Two Functions, One Common Form: void <name> ( ) { } all symbols + placement, matter  Every statement ends with a semicolon (;)  The software colors text it understands – helpful  Some functions include stuff inside parentheses; these are called arguments  If a function has arguments, each position has a specific meaning: size(<width>, <height>); stroke(<red value>, <green value>, <blue value>);  If your cursor is by a closing parenthesis or brace, the matching parenthesis or brace is highlighted Keywords are highlighted in blue Processing is case sensitive; notice! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

The Color Purple Colors in most Web programming are given as three values: RGB, for red, green, blue The Color Purple, for example, is:  128,0,128   These positions are the intensity of the little lights that make up a pixel on the screen The least intensity is 0, that is, off The greatest intensity is 255, maximum brightness Amazingly, the three max RGB colors make white So, purple is ½ intensity of Red, no Green, and ½ intensity of Blue … makes sense 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Questions about “Iron Rich Snow” The angel is on an rust-colored background specified by: background(192, 64, 0); … which means? Stroke sets line color: stroke(255,255,255); Suppose the angel is “iron rich” and the snow white Fill sets color of object: fill(128, 0, 128); 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

It’s All The Same When the values for RGB are all the same, it’s some color of gray, or white, or black Since writing background(255,255,255) is kind of a drag, Processing allows us to give just one argument; so background(255) is equivalent to giving all three 255s What colors are these backgrounds? background(255,0,0); background(64); background(0,0,64); 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Simple Shapes Make Robots Reas and Fry, in their book, show us a cute robot they programmed using simple shapes They give their code and we can see how they built it To make the point that all code must “make sense” – its not gibberish – lets look at it even though we don’t know Processing yet 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Robot Code, 1 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Robot Code, 2 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)

Knowing Only About Color … We “improve” the robot by adding some color Do it in a demo Just Do It! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010-2012 Larry Snyder, CSE)