Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/13/08.

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning
Advertisements

Processing the Danger Shield Everything you wanted to know about Processing but were afraid to ask By Ben Leduc-Mills.
Introduction to Programming
Introduction to shapes
A Quick Introduction to Processing
Processing Lecture. 1 What is processing?
Variables and Operators
Recursion October 5, Reading Read pp in the text.
CSC 123 – Computational Art Introduction to Shape and composition
Graphics Programming. In this class we will cover: Drawing lines, rectangles, and ellipses Copying an area Drawing an image.
 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 (Skipped Curves 79-84)
IAT 334 Java using Processing ______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
Slides prepared by Rose Williams, Binghamton University Chapter 19 Swing II.
, Fall 2006IAT 800 Lab 2: Polygons, Transformations, and Arrays.
Higher-level PHP constructs for manipulating image files.
Using Coordinate Geometry to Create Moving Images In unit 29 we created a simple drawing for the background of a children’s game. We are going to start.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
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.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/6/08.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Creating Art With Simple Shapes By carefully implementing simple shapes to an HTML canvas we can create useful graphics. With enough time, lines, ellipses.
Functions. Functions are named blocks of code. Functions allow complex programs to be broken down into smaller, simpler tasks. Functions allow commonly.
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.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
What are these shapes? squarecircletrianglerectangle How many sides do each have? How many points do each have?
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
Algorithmic Problem Solving IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 10, 2013 Marie desJardins University of Maryland, Baltimore.
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays Evan.
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.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
CRE Programming Club - Class 5 Robert Eckstein and Robert Heard.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
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.
B. RAMAMURTHY Processing and Programming cse
Computation as an Expressive Medium Lab 2: Polygons, Transformations, and Arrays (Oh My) Micah.
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
Surface Area and Volume. Day 1 - Surface Area of Prisms Surface Area = The total area of the surface of a three-dimensional object (Or think of it as.
Pear Diamonds Step 1: The Outline of the Pear Draw a simple shape of a pear of your choice, or use this template. Keep the shape simple and easily identifiable.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/20/08.
LOGO WHAT IS IT? HOW TO USE IT AND HOW USEFUL CAN IT BE?
What is it? How to use it and how useful can it be?
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.
LOGO BY Kaotip 9S.
Processing Introduction CSE 120 Spring 2017
Chapter 14, Translate & Rotate
Polygons, Transformations, and Arrays
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Basic Input and Output CSE 120 Winter 2018
به نام مهربانترین In the name of the most compassionate
Processing and Drawing CSE 120 Winter 2018
Exam1 Review CSE113 B.Ramamurthy 11/29/2018 B.Ramamurthy.
Chapter 5, Conditionals Brief Notes
What employers and colleges expect you to have.
Here are four triangles. What do all of these triangles have in common
Lecture 7: Introduction to Processing
IAT 265 Lecture 2: Java Loops, Arrays Processing setup, draw, mouse Shapes Transformations, Push/Pop.
Basic Input and Output CSE 120 Winter 2019
Just a question for Mac users:
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Chapter 4, Variables Brief Notes
Computation as an Expressive Medium
Lets shape up! Pages:
Chapter 13, Math A few Examples.
Lets shape up! Pages:
Exam3 Review CSE113 B.Ramamurthy 10/11/2019 B.Ramamurthy.
Presentation transcript:

Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/13/08

Who are we? We’re MIT students. Ms. YenMs. Fischer Ms. Madsen

Quick review of last week’s material: Remember that green  numbers, blue  names. void setup() { color colorName; colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { rect(xStart, yStart, width, height); ellipse(xStart, yStart, width, height); }

Review of rect() #2: yStart #1: xStart #3: width #4: height rect(xStart, yStart, width, height);

Review of ellipse() #3: width #4: height ellipse(xStart, yStart, width, height); #2: yStart #1: xStart

Rules for naming things (for example, colors): The name… –Must start with a LETTER (not a number or symbol.) –Must not have any spaces. –Can’t be a special word, like ‘color’ or ‘size’ or ‘background’.

We can use fill() to give color to our shape. First, create a color, like we did for background: color colorName2 = color(redValue2, greenValue2, blueValue2); Then, call fill() with that color name as an argument: fill(colorName2);

New material: fill! Remember that green  numbers, blue  names. void setup() { color colorName; colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { color colorName2 = color(redValue2, greenValue2, blueValue2); fill(colorName2); rect(xStart, yStart, width, height); ellipse(xStart, yStart, width, height); }

We use stroke the same way as fill. You can set the outline color of a shape by using stroke() with a color name. All of the shapes will use the same stroke color until you change it. Also, instead of giving a color name, you can just give the three RGB values directly instead. (You don’t have to create a color for each fill/stroke statement.) So you can do this: stroke(colorName3); Or this: stroke(redValue3, greenValue3, blueValue3);

New material: stroke! Remember that green  numbers, blue  names. void setup() { color colorName; colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { color colorName2 = color(redValue2, greenValue2, blueValue2); fill(colorName2); stroke(redValue3, greenValue3, blueValue3); rect(xStart, yStart, width, height); ellipse(xStart, yStart, width, height); }

We can use strokeWeight to change the thickness of our outline. strokeWeight takes just one argument: a number that can have a decimal point (called a float, which stands for “floating-point decimal.”) You can call strokeWeight before your shapes to make the outlines thicker or thinner. The existing strokeWeight for all your outlines is 1, but you can change it by setting a different strokeWeight.

New material: strokeWeight! Remember that green  numbers, blue  names. void setup() { color colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { color colorName2 = color(redValue2, greenValue2, blueValue2); fill(colorName2); stroke(redValue3, greenValue3, blueValue3); strokeWeight(lineThickness); rect(xStart, yStart, width, height); ellipse(xStart, yStart, width, height); }

What’s the command to make triangles? triangle(), of course! triangle() takes six arguments, which are coordinate pairs for the three corners of a triangle. So the command looks like this: triangle(x1, y1, x2, y2, x3, y3);

Here’s what that looks like. #4: y2 #1: x1 #5: x3 #6: y3 triangle(x1, y1, x2, y2, x3, y3); #3: x2 #2: y1

New material: triangle! Remember that green  numbers, blue  names. void setup() { color colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { color colorName2 = color(redValue2, greenValue2, blueValue2); fill(colorName2); stroke(redValue3, greenValue3, blueValue3); strokeWeight(lineThickness); rect(xStart, yStart, width, height); ellipse(xStart, yStart, width, height); triangle(x1, y1, x2, y2, x3, y3); }

You can make custom shapes by using the beginShape command. The custom shape command starts with beginShape(). You then give the x, y coordinates of a series of vertices like this: vertex(x, y); Finally, finish your shape with endShape(). You can also try using endShape(CLOSE) instead.

New material: beginShape/vertex/endShape! Remember that green  numbers, blue  names. void setup() { color colorName = color(redValue, greenValue, blueValue); background(colorName); size(width, height); } void draw() { beginShape(); vertex(x, y); endShape(); // try using endShape(CLOSE) instead. }