Code Elements and Processing Coordinate System

Slides:



Advertisements
Similar presentations
Lesson One: The Beginning
Advertisements

Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
Code Elements and Processing Coordinate System. Code elements: pages Comments: are documentation notes that are ignored by the computer but are.
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
Translate, Rotate, Matrix Pages Function Function Definition Calling a function Parameters Return type and return statement.
Image Maps and Graphics Internet Basics and Far Beyond! Mrs. Wilson.
IAT 334 Java using Processing ______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY.
IAT 800 Foundations of Computational Art and Design Lecture 2.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Lesson Three: Organization
PROCESSING. * Java SDK * downloads/jdk7-downloads html
Java Programming, 2E Introductory Concepts and Techniques Chapter 2 Creating a Java Application and Applet.
Intro to Java & Processing. Review CS is about problem-solving CS is about problem-solving To write programs you must To write programs you must –Be able.
Coding: Games, Apps and the Arts Unit 0: Processing Basics 1.
1 k Jarek Rossignac,  2008 Processing  Install Processing  Learn how to edit, run, save, export, post programs  Understand.
Continuous February 16, Test Review What expression represents the zip car eligibility rules of at least 18 years old and no incidents?
Keyboard and Events. What about the keyboard? Keyboard inputs can be used in many ways---not just for text The boolean variable keyPressed is true if.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Variables and Arithmetic. From last class More drawing functions: strokeWeight(n); // higher the n value broader the stroke fill(k) ; // single parameter.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 9, 2014 Carolyn Seaman Susan Martin University of Maryland, Baltimore.
Review of ArT3 Programming Course David Meredith Aalborg University
______________________________________________________________________________________ SCHOOL OF INTERACTIVE ARTS + TECHNOLOGY [SIAT] |
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02b: Tutorial for Programming in Processing Jarek Rossignac.
B. RAMAMURTHY Simulating Motion and Implementing Animation.
2-D Shapes, Color, and simple animation. 7 Basic Shapes Ellipse :: ellipse() Arc :: arc() Line :: line() Point :: point() Rectangle :: rect() Triangle.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Arrays. An array is a collection “The Dinner offers an array of choices.” In computer programming, an array is a collection of variables of the same data.
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.
LCC 6310 Computation as an Expressive Medium Lecture 2.
Words. Characters and Strings Character –A single character inside of single quotes char letter = 'A' ; char digit = '0' ; – Strings Zero or more character.
Creating a Java Application and Applet
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
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.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
PROCESSING A computer screen is a grid of small light elements called pixels.
Functions. 2 Modularity What is a function? A named block of code Sometimes called a ‘module’, ‘method’ or a ‘procedure’ Some examples that you know are:
Chapter 02 Data and Expressions.
MOM! Phineas and Ferb are … Aims:
Some of Chap 17.
Pixels, Colors and Shapes
Chapter 3 Syntax, Errors, and Debugging
Inserting and Working with Images
Chapter 8 Objects.
Example: Card Game Create a class called “Card”
Chapter 7 Functions.
Computation as an Expressive Medium
Computer Programming.
Chapter 7 Functions.
Java Programming with BlueJ
Language Basics.
Exam1 Review CSE113 B.Ramamurthy 11/29/2018 B.Ramamurthy.
Pixels.
Chapter 5, Conditionals Brief Notes
Variables and Arithmetic
More programming with "Processing"
Code Elements and Processing Coordinate System
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 8 Objects.
Tonga Institute of Higher Education IT 141: Information Systems
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Tonga Institute of Higher Education IT 141: Information Systems
How About Some PI? Trigonometry Feb 18,2009.
IAT 800 Foundations of Computational Art and Design
LCC 6310 Computation as an Expressive Medium
Using Modules.
Presentation transcript:

Code Elements and Processing Coordinate System

Code elements: pages 17-21 Comments: are documentation notes that are ignored by the computer but are important for people (to understand the code). // single line comment /* multi line comment */ Semi-colon (“;” ) is a terminator Example: size (600, 600);

Functions Functions are pre-defined operations You can define the functions or use the functions already defined and available in libraries/packages Functions promote modular design Example: size(500,500); background(102); parameters Function call

Expressions Expression are means for expressing a computation or logic Example: 56 + 100 value is 156 89 > 90 value is false

Variables and types Variables represent items in the problem to be solved Variables have (i) type (ii) name by which they are referenced in the code Example: int age; float wage; char initial; We will discuss variables in more detail later.

Console and Printing Messages Processing has two instructions for printing out on console: print(…) and println(..) These can be used to display data when a Processing code is running Good instructions for understanding your code and trace what is happening with the code. Good “debugging” tool. Example: (see p.21) int x = 20; println(x); int x2 = 20; int y2 = 30; println(x2 + “ “ + y2); println(“I am learning Problem solving using Processing”);

Coordinates and Primitives Before you “draw” you need to think about dimensions and qualities of the surface on which you’ll be drawing. Computer monitor have surfaces that are defined by “pixels” or a “picture element” When the definition of the screen of your laptop is 1280 X 1024 that means you have 1,310,720 little pixels to display your content on the screen In processing when you say “size (200, 100)” we have width of 200 pixels and height of 100 pixels

Processing Coordinate System (10X10) 0,0 Y  10,10

Primitive Shapes point(x,y) Example: point(2, 67); line(x1,y1, x2, y2) Example: line(23,45, 56,90); triangle(x1,y1,x2,y2,x3,y3); Example: triangle(60,10,25,60,75,65);

More Primitive Shapes quad(20,20,20,70,60,90,60,40); Quad is specified using points Rect function uses starting point and lengths rect(x, y, width, height); ellispe(x,y,width,height); // is used for drawing circle

Complete example Lets draw a desktop computer. rect(0, 0, 90, 50);

Drawing attributes fill(r,g,b); Before you draw will fill the object you draw with the fill color. smooth(); noSmooth(); strokeWidth(6); noStroke(); Lets try these commands on Processing