2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.

Slides:



Advertisements
Similar presentations
Basics of motion. Fluid motion Fluid motion is best achieved with floats, try and work out why: floats have decimal places, which provide more resolution,
Advertisements

Lesson One: The Beginning
Graphics Shapes. Setup for using graphics You have to import the graphics library You can use either “import graphics” or “from graphics import *” or.
Processing the Danger Shield Everything you wanted to know about Processing but were afraid to ask By Ben Leduc-Mills.
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?
Variables and Operators
Recursion October 5, Reading Read pp in the text.
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
CSC 123 – Computational Art Introduction to Shape and composition
© Calvin College, Being abstract is something profoundly different from being vague... The purpose of abstraction is not to be vague, but to create.
Grundaufbau import processing.core.PApplet; public class Proc_Minimal extends PApplet { public void setup(){ size(1024, 768); frameRate(60.0f);
Color by Numbers Pages Syntax Introduced color color() colorMode()
Translate, Rotate, Matrix Pages Function Function Definition Calling a function Parameters Return type and return statement.
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.
IAT 800 Foundations of Computational Art and Design ______________________________________________________________________________________ SCHOOL OF INTERACTIVE.
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.
G RAPHICS & I NTERACTIVE P ROGRAMMING Lecture 1 Introduction to Processing.
FUNDAMENTALS OF PROGRAMMING SM1204 SEMESTER A 2012.
Animating Coordinate Geometry In this unit we will expand upon our knowledge of using counters to create motion pictures. By using incremental mathematics,
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.
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
Variables and Arithmetic. From last class More drawing functions: strokeWeight(n); // higher the n value broader the stroke fill(k) ; // single parameter.
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Functions. Functions are named blocks of code. Functions allow complex programs to be broken down into smaller, simpler tasks. Functions allow commonly.
Review Loops – Condition – Index Functions – Definition – Call – Parameters – Return value.
1 Taif University Faculty Of Computers And Information Technology TA. Kholood Alharthi & TA. Maha Thafar First Semester AH.
Animation Pages Function Function Definition Calling a function Parameters Return type and return statement.
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.
CPSC 217 T03 Week II Part #1: SimpleGraphics.py Hubert (Sathaporn) Hu.
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
Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.
What is Computing? What can be Programmed? Creative Computing Processing Downloading Processing Dropbox Primitive Shapes – point – line – triangle – quad.
Programming in Processing Taught by Ms. Madsen Assistants: Ms. Fischer and Ms. Yen Winsor School, 2/20/08.
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.
Processing Lecture.3 Loop and animation
Some of Chap 17.
Chapter 14, Translate & Rotate
Lesson One: The Beginning Chapter 1: Pixels Learning Processing Daniel Shiffman Presentation by Donald W. Smith Graphics from
20 minutes maximum exhibits
Chapter 7 Functions.
Chapter 6 Loops (iteration).
Chapter 7 Functions.
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.
Chapter 5, Conditionals Brief Notes
Variables and Arithmetic
Code Elements and Processing Coordinate System
Performing Essential Operations
Just a question for Mac users:
Translate, Rotate, Matrix
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Loops & Nested Loops CSE 120 Winter 2019
Processing Environment
Chapter 10 Algorithms.
Trigonometry & Random March 2, 2010.
How About Some PI? Trigonometry Feb 18,2009.
Chapter 13, Math A few Examples.
Presentation transcript:

2-D Shapes, Color, and simple animation

7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle :: triangle() Quadrilateral :: quad()

Shapes Syntax point(x,y); line(x1, y1, x2, y2); rect(x, y, width, height); triangle(x1, y1, x2, y2, x3, y3); quad(x1, y1, x2, y2, x3, y3, x4, y4); ellipse(x, y, width, height);

Arc Syntax : arc(x, y, width, height, start, stop); Arcs are drawn along the outer edge of an ellipse defined by the x, y, width and height parameters. The origin or the arc's ellipse may be changed with the ellipseMode() function. The start and stop parameters specify the angles at which to draw the arc.

All colors as well… 4 functions to control color in different parts of any sketch: Background Fill Stroke ColorMode

Background / Fill / Stroke Fill, Background, Stroke use identical syntax noFill() disables filling of geometry. noStroke(); disables drawing the stroke (outline) background(value1, value2, value3) background(value1, value2, value3, alpha) background(gray) background(gray, alpha) background(hex) background(hex, alpha)

ColorMode Use color mode to change your color parameters to mean HSB or RGB. colorMode(mode); colorMode(mode, range); colorMode(mode, range1, range2, range3); colorMode(mode, range1, range2, range3, range4);

Animating :: you got to move it

Simple Animation Replace the parameters for placement of an object with variables and make these values change over time: ellipse(x, y, 100, 100); To make objects grow and shrink, replace their width and height with variables as well: ellipse(x, y, w, h);

Animating with ‘if’ statements if (x <= 900) { x = x + 20; } else { x = 0; } How about the other parameters?

Now don’t be scurred…. Functions…

Anatomy of a function float myFunction(int x, int y) { float z = (x/5) * y; return z; } Name of function Incoming arguments Statements Return value