PROCESSING A computer screen is a grid of small light elements called pixels.

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
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
Introduction to shapes
A Quick Introduction to Processing
Processing Lecture. 1 What is processing?
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.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
Grundaufbau import processing.core.PApplet; public class Proc_Minimal extends PApplet { public void setup(){ size(1024, 768); frameRate(60.0f);
 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 Syntax Introduced color color() colorMode()
Translation and Rotation in 2D and 3D David Meredith Aalborg University.
Color by Numbers Pages (Skipped Curves 79-84)
GUI and Swing, part 2 The illustrated edition. Scroll bars As we have previously seen, a JTextArea has a fixed size, but the amount of text that can be.
FUNDAMENTALS OF PROGRAMMING SM1204 Semester A 2011.
Copyright 2006 by Pearson Education 1 Building Java Programs Supplement 3G: Graphics.
, Fall 2006IAT 800 Lab 2: Polygons, Transformations, and Arrays.
Higher-level PHP constructs for manipulating image files.
Drawing pictures with Java. JFrame: the basic Java window The swing package contains classes, objects and methods that can be used to create a consistent.
2-D Shapes What is a 2D Shape and how do we define it?
PROCESSING. * Java SDK * downloads/jdk7-downloads html
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
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.
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.
Variables and Arithmetic. From last class More drawing functions: strokeWeight(n); // higher the n value broader the stroke fill(k) ; // single parameter.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
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.
Graphic Basics in C ATS 315. The Graphics Window Will look something like this.
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.
(C) 2010 Pearson Education, Inc. All rights reserved.  Class Graphics (from package java.awt) provides various methods for drawing text and shapes onto.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
Surface Area of Pyramids and Cones Pyramid Cones Has a square base and comes to a point Has a circle base and comes to a point.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
NoufNaief.net 1 TA: Nouf Al-Harbi.
Computer Science I 3D Classwork / Homework: plan and implement your own 3D example.
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,
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.
Element of Design Form Shape Line Color Value Texture Space.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
1 Sections 5.1 – 5.2 Digital Image Processing Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/20/08.
Introduction to Processing David Meredith Aalborg University Art &Technology, 3rd Semester Programming.
Some of Chap 17.
Pixels, Colors and Shapes
Chapter 14, Translate & Rotate
Starburst.
Example: Card Game Create a class called “Card”
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
Basic Graphics Drawing Shapes 1.
Chapter 14 JavaFX Basics Dr. Clincy - Lecture.
Code Elements and Processing Coordinate System
4.14 GUI and Graphics Case Study: Creating Simple Drawings (Cont.)
Exam1 Review CSE113 B.Ramamurthy 11/29/2018 B.Ramamurthy.
Introduction to Computer Graphics
Code Elements and Processing Coordinate System
Drawing a Stick Figure!.
Warm Up Problem of the Day Lesson Presentation Lesson Quizzes.
Lecture 7: Introduction to Processing
Processing and Drawing CSE 120 Winter 2019
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Processing Environment
Presentation transcript:

PROCESSING A computer screen is a grid of small light elements called pixels.

The Interface

Predefined methods to draw shapes. These predefined shapes require different arguments in the parameter. Arguments: Beginning x, y position Ending x, y position Arguments: Beginning x, y position Arguments: 1 st x, y position 2 nd x, y position 3 rd x, y position These are connected to make the triangle

Arguments: Requires 4 x and y positions for each point. The points are connected Arguments: Beginning point x, y and the width & height width + beginning x = ending x Height + y = ending y

Tips to draw other shapes square, you need to use the rect(int x, int y, int width, int height) and use the same value for the width and height circle, you can use the ellipse(int x, int y, int width, int height) function with the same value for the width and height. triangle() function is used with six parameters. These are three x/y coordinates for the three points of the triangle. You should try to draw these points clockwise on the screen to keep things simple. The quad() is similar to the triangle() function, but uses eight parameters, as a quad has four points.

Attributes of shapes attributes of shapes are controlled with other code elements. size(int x, int y); background(int colorNum); // used to set the background color of the frame stroke(int num, int num, int num) ; // used to change the color of a line fill(int num); // used to fill a shape with a shade of gray fill(int colorNum, int colorNum, int colorNum); // used to fill a shape with a color noFill(); noStroke() strokeWeight(int num), strokeCap(), strokeJoin() smooth(), noSmooth(), ellipseMode(), rectMode()

Setting colors The intensities of each color element are specified with values between 0 and 255 In Processing, colors are defined by the parameters to the background(value1, value2, value3) fill(value1, value2, value3) fill(value1, value2, value3, alpha) stroke(value1, value2, value3) stroke(value1, value2, value3, alpha) Fill is used with shapes that have a width and height. Stroke is used with lines background(242, 204, 47); RGB VALUES FOR COLOR: Color ranges from 0 to 255 background(75, 255, 150); Would produce some color

This is the code to make these different shapes

Ice Cream Cone background(255, 162, 0); fill(0, 255, 255); ellipse(200, 92, 80, 80); // Top scoop fill(242, 0, 255); ellipse(200, 141, 80, 80); // Middle scoop! fill(255, 204, 0); ellipse(200, 187, 80, 80); // Bottom scoop! fill(0, 13, 255); rect(150, 200, 107, 112); // The cup! fill(255, 0, 0); ellipse(200, 46, 20, 20); // The cherry, yum line(200, 27, 200, 36); // And the cherry stem

Drawing with coordinates

Different x Same y

Drawing Custom Shapes Processing has a beginShape() method to draw custom shapes by specifying specific vertex x and y point on the grid. It will connect the points to draw the shape. End the procedure with endShape();

Work on Your Initial/Logo project Refer to your rubric