Lesson One: The Beginning

Slides:



Advertisements
Similar presentations
Time Sheet Training Press the F5 Key to view the Presentation. It may be helpful to have a printed copy of this slide presentation for the practice sessions.
Advertisements

Slide 1 CheVi Tutorial Aniko Simon, Darryl Reid, Sing Yoong Khew, and Zsolt Zsoldos SimBioSys presents.
You have been given a mission and a code. Use the code to complete the mission and you will save the world from obliteration…
Lists (also called Arrays) A list is an example of a collection: a data type that is capable of storing other data types. foods = ["spam", "eggs", "sausage",
Chapter 13 Graphics.
Fundamentals of Engineering
Applets and Graphics.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
ZMQS ZMQS
Word Lesson 6 Working with Graphics
Variables Conditionals Boolean Expressions Conditional Statements How a program produces different results based on varying circumstances if, else if,
Lesson One: The Beginning Chapter 3: Interaction Learning Processing: by Daniel Shiffman Presentation by Donald W. Smith Graphics from text.
How To Use Google Forms to Create A Test Quick Easy Self-Graded!! Instant Reports.
ABC Technology Project
Creating Tables in a Web Site
Adobe InDesign CS5 - Illustrated Unit G: Working with Color and Tables.
Filling and Wrapping Review Sheet
Copyright 2010 by Pearson Education Building Java Programs More Graphics reading: Supplement 3G.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
2D Graphics Drawing Things. Graphics In your GUI, you might want to draw graphics E.g. draw lines, circles, shapes, draw strings etc The Graphics class.
Surface Area of Irregular Shapes Volume of Irregular Shapes
 putpixel function plots a pixel at location (x, y) of specified color.  Declaration :- void putpixel(int x, int y, int color);
Graphing y = nx2 Lesson
Lab # 03- SS Basic Graphic Commands. Lab Objectives: To understand M-files principle. To plot multiple plots on a single graph. To use different parameters.
PowerPoint Design Quiz True or False By PresenterMedia.comPresenterMedia.com.
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® PowerPoint 2010 © 2011 The McGraw-Hill Companies,
Week 1.
Week 10 Creating Positioned Layouts
We will resume in: 25 Minutes.
1 Unit 1 Kinematics Chapter 1 Day
13- 1 Chapter 13: Color Processing 。 Color: An important descriptor of the world 。 The world is itself colorless 。 Color is caused by the vision system.
 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 30 - Dynamic HTML: Structured Graphics ActiveX Control Outline 30.1Introduction 30.2Shape Primitives.
Frame Windows A frame object is used to create a graphical frame window. This frame is used to show information in a graphical application. The JFrame.
Graphics Shapes. Setup for using graphics You have to import the graphics library You can use either “import graphics” or “from graphics import *” or.
Chapter 2: Using Objects Part 2. Assume you wish to test the behaviour of some method. This is accomplished by providing a tester class: Supply a main.
Introduction to Programming
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
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()
Color by Numbers Pages (Skipped Curves 79-84)
Lesson One: The Beginning
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.
Coding: Games, Apps and the Arts Unit 0: Processing Basics 1.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Tkinter Canvas.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
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.
Paint Tutorial Created February 2006 Start Paint: Start>Programs>Accessories>Paint.
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
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Basic Graphics Drawing Shapes 1.
SSEA Computer Science: Track A
Images Presentation Name Course Name Unit # – Lesson #.# – Lesson Name
Presentation transcript:

Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from http://www.learningprocessing.com/tutorials/

Lesson One: The Beginning 1: Pixels Specifying pixel coordinates Basic shapes: point, line, rectangle, ellipse Color: grayscale, “RGB” Color Transparency 2: Processing 3: Interaction Learning Processing: Slides by Don Smith

Graph Paper Every point on the screen is a pixel It has a location: (x, y) Learning Processing: Slides by Don Smith

Coordinate System Upper left corner is 0,0 NOT the same as your Algebra coordinate system! Upper left corner is 0,0 X is ‘across’ (to right as x increases) Y is ‘down’ (down as y increases) Learning Processing: Slides by Don Smith

Simple Shapes What do we need to specify a shape? Point: x and y Line: Two end points? Rectangle: Two corners? Or ??? Ellipse: ???? Learning Processing: Slides by Don Smith

Point Note that x (across) comes first In Processing: point(x, y); lower case ‘point’ two ‘parameters’ in parenthesis Semicolon; Learning Processing: Slides by Don Smith

Line Two Points: A and B In Processing: line(x1, y1, x2, y2); lower case ‘line’ four ‘parameters’ in parenthesis Semicolon; Learning Processing: Slides by Don Smith

Drawing a Rectangle mode 1: rectMode(CORNER); From Corner: One Point for top left corner In Processing: rect(x, y, width, height); lower case ‘rect’ four ‘parameters’ in parenthesis Semicolon; NOTE: This is the default mode rectMode(CORNER); Learning Processing: Slides by Don Smith

Drawing a Rectangle mode 2: rectMode(CORNER); From Center: One point, size In Processing: rectMode(CENTER); rect(x, y, width, height); Two lines of code Learning Processing: Slides by Don Smith

Drawing a Rectangle mode 3: rectMode(CORNERS); CORNERS: Top Left point, Bottom Right point In Processing: rectMode(CORNERS); rect(x1, y1, x2, y2); Two lines of code Learning Processing: Slides by Don Smith

Same as rectangle modes: Ellipse Modes: EllipseMode(CENTER), EllipseMode(CORNER), EllipseMode(CORNERS) Same as rectangle modes: CENTER (x, y, width, height) CORNER (x, y, width, height) CORNERS (x1, y1, x2, y2) Draws ellipse in a ‘Bounding box’ Circle is a ‘special case’ of an ellipse (width = height) Learning Processing: Slides by Don Smith

Even more shapes and curves are possible: More 2D primitives and Curves are possible Goto processing.org/reference to see all the possibilities arc() ellipse() line() point() quad() rect() triangle() bezier() bezierDetail() bezierPoint() bezierTangent() curve() curveDetail() curvePoint() curveTangent() curveTightness() Try more out and see what you can create Learning Processing: Slides by Don Smith

Color: Grayscale You can set the color of lines and background: 0 is black (no ‘light’) 255 is white (most ‘light’) Some examples in processing: background(255); // Sets background to white stroke(0); // Sets outline to black fill(150); // Sets interior of a shape to grey rect(50,50,75,100); // Draws shape with most recent settings Learning Processing: Slides by Don Smith

Grayscale Example To fill or not to fill If noFill() is set, shapes have only an outline What are the ‘default’ grayscales of: Background: Stroke: Fill: Learning Processing: Slides by Don Smith

You can specify the size of your ‘canvas’ at the start of a ‘script’ Canvas Size Matters You can specify the size of your ‘canvas’ at the start of a ‘script’ size(width, height); The default size if unspecified is 100px x 100px Type the sketch below and run it to see for yourself println(width); println(height); // this will print the canvas size to the console Use 200 x 200 to get started Learning Processing: Slides by Don Smith

Make your own Graph paper Weblink to make your own graph paper Create graphpaper with 12 lines per inch for a 8.5 x 11 page Use a line weight of 0.75 Print off some pages to help you plan your work Learning Processing: Slides by Don Smith

Now Get to Work! Plan how to draw an alien! Use Black lines and White fill for now Assume size is 200 x 200 Learning Processing: Slides by Don Smith

RGB Color Color Mixing 101: RGB Values Red + Green = Yellow Red + Blue = Purple Green + Blue = Cyan (blue-green) Red + Green + Blue = White no colors = Black RGB Values Each color has a value between 0 and 255 0 means NONE of that color 255 means MAX of that color Learning Processing: Slides by Don Smith

Manual Colors background(255); noStroke(); fill(255,0,0); // Bright red ellipse(20,20,16,16); fill(127,0,0); // Dark red ellipse(40,20,16,16); fill(255,200,200); // Pink (pale red) ellipse(60,20,16,16); Use fill(),background() or stroke() with three parameters: fill(red, green, blue); Then draw a shape! Learning Processing: Slides by Don Smith

Picking Colors Processing has a color selector to aid in choosing colors. Access this via TOOLS (from the menu bar) → COLOR SELECTOR. Learning Processing: Slides by Don Smith

Transparency There is a fourth ‘parameter’ you can use: Called ‘Alpha’ // 50% opacity. fill(255,0,0,127); // 25% opacity. fill(255,0,0,63); rect(0,150,200,40); There is a fourth ‘parameter’ you can use: Called ‘Alpha’ 0 means transparent 255 means opaque No fourth parameter means ‘100% opacity’ Learning Processing: Slides by Don Smith

Now Get to Work! Plan a more interesting alien! Use grayscale! Black eyes Gray body Learning Processing: Slides by Don Smith

Summary Pixels are points on the screen You can use basic shapes X and Y coordinates start at 0,0 for upper left You can set the ‘canvas’ size at the start of your ‘script’ You can use basic shapes Point, Line, Rectangle, Ellipse, even more on the website Shapes can be drawn in different ‘modes’ CENTER, CORNER, CORNERS Stroke, Fill and Background can be set for: Grayscale parameter can be used to control RGB parameters (three) can set color Transparency with fourth parameter of RGB Learning Processing: Slides by Don Smith