GMU:Processing im Park/Part1: Difference between revisions

From Medien Wiki
(Created page with "=Image Basics= In the first part of this course you will learn the basics of working with images in your computer. Forget Photoshop and illustrator. You 've got the power! == W...")
 
No edit summary
Line 59: Line 59:
If this is all mumbo-jumbo to you, you better be quick, and start learning to code. Here is how to survive:
If this is all mumbo-jumbo to you, you better be quick, and start learning to code. Here is how to survive:


# If you love watching TV check out Dan Shiffmans Vimeo, or go to [[http://hello.processing.org]] (its just 1 hour!) – Highly recommended!
# If you love watching TV check out Dan Shiffmans Vimeo, or go to [[http://hello.processing.org hello.processing.org]] (its just 1 hour!) – Highly recommended!
# If you prefer to learn by example check out [[http://openprocessing.org OpenProcessing.org]] and [[http://sketchbook.cc Sketchbook.cc]]
# If you prefer to learn by example check out [[http://openprocessing.org OpenProcessing.org]] and [[http://sketchbook.cc Sketchbook.cc]]
# If you prefer to read a book, check out the [[https://processing.org/books/ Processing books]].
# If you prefer to read a book, check out the [[https://processing.org/books/ Processing books]].


== Cut-Ups, Pixels, Stripes, Collages ==
== Cut-Ups, Pixels, Stripes, Collages ==

Revision as of 21:13, 27 October 2015

Image Basics

In the first part of this course you will learn the basics of working with images in your computer. Forget Photoshop and illustrator. You 've got the power!

Working with Images

Collecting Images

  1. Pick a topic from the big topic tombola
  2. Go to the Ilm-Park and take 100 photos in 45 minutes
  3. ???
  4. Profit

Programming Crash Course

Syntax

  • Processing uses Java Syntax
  • A Syntax Error means you got the spelling wrong, or you need to take some grammar lessons.
  • Processing is picky about missing semicolons.
  • Add a semicolon to the end of every line and you're fine (;

Functions

  • Function Calls:
    • function calls can take one or more function arguments given in round brackes
    • function calls result in a value (or void)
    • functions can have side effects for example: drawing something on screen.
    • loadImage("park_001.png"); – calling a function to load an image
    • image(i, 0, 0); – calling a function to display an image
  • Examples
  • Functions Definitions:
    • define what argument a function takes (and which types those arguments have)
    • define what a function does
    • define what a function returns (and what type)
    • void draw() – tell the computer what to do to draw a single frame
    • void setup() – tell the computer what to do to set everything up.

Expressions

  • Any combo of numbers and mathematical operators
  • return a result
  • Can be used as argument to a function
  • can be assigned to a variable

Variables

  • In typed languages like Java every variable has a type
  • use variable declaration to tell the computer the variable exists
    • example: int i;
  • use variable definitions to assign a value to a variable
    • example: i = 1;
  • you can combine variable definition and declaration
    • example: int i = 1;'

Types

  • Number Types:
    • float – floating point (Real Numbers), i.e. 0.1, 1e10
    • int – Integer (Whole Number), i.e. 1, -100, 20000
    • byte – 8 bits (Number between -128 and +127)
  • Text Types
    • String – String (Sequence of Characters) i.e. "Processing im Park"
    • char – a single character, i.w. 'A' or 'a' or ' '

If this is all mumbo-jumbo to you, you better be quick, and start learning to code. Here is how to survive:

  1. If you love watching TV check out Dan Shiffmans Vimeo, or go to [hello.processing.org] (its just 1 hour!) – Highly recommended!
  2. If you prefer to learn by example check out [OpenProcessing.org] and [Sketchbook.cc]
  3. If you prefer to read a book, check out the [Processing books].

Cut-Ups, Pixels, Stripes, Collages