Difference between revisions of "Introduction to Processing"
(→Where does a Processing Program actually run?) |
(→How do We Write Processing Programs) |
||
Line 49: | Line 49: | ||
* etc... (see the [http://processing.org/exhibition/ exhibition page] on Processing for additional examples of interactions). | * etc... (see the [http://processing.org/exhibition/ exhibition page] on Processing for additional examples of interactions). | ||
− | == | + | ==Writing a Processing Program== |
First we need to download and install Processing on our computer. See the [http://processing.org/download/ Processng Download] page for more information. | First we need to download and install Processing on our computer. See the [http://processing.org/download/ Processng Download] page for more information. | ||
Line 58: | Line 58: | ||
<center> | <center> | ||
[[Image:ProcessingIDE1.png| 300px]] | [[Image:ProcessingIDE1.png| 300px]] | ||
+ | </center> | ||
+ | <br /> | ||
+ | |||
+ | ==Running a Processing Program== | ||
+ | |||
+ | This part is simple, just click on the round button with a triangle in it, at the top left of the IDE, and this should start the program. | ||
+ | |||
+ | <br /> | ||
+ | <center> | ||
+ | [[Image:ProcessingIDE2.png|500px]] | ||
</center> | </center> | ||
<br /> | <br /> |
Revision as of 13:15, 26 February 2012
--D. Thiebaut 11:12, 26 February 2012 (EST)
This is a tutorial introducing Processing, created by Ben Fry and Casey Reas, originally of MIT. This tutorial assumes no programming background. |
Contents
Introduction
Fry and Reas present a nice and concise introduction to Processing in [1]. Quoting from their paper:
Processing is a programming language and environment built for the media arts communities. It is created to teach fundamentals of computer programming within the media arts context and to serve as a software sketchbook. It is used by students, artists, designers, architects, and researchers for learning, prototyping, and production. This essay discusses the ideas underlying the software and presents its relationship to open source software and the idea of software literacy. Additionally, Processing is discussed in relation to education and online communities.
How does Processing work?
General Block Diagram
When a Processing program is started, two actions take place:
- the setup() function is executed by the processor. This happens only once. This is always the first action taken, and for this reason this function is a good place to put code that will define the shape of the applet, and anything settings that will remain constant throughout the execution of the program
- the draw() function is executed. And as soon as it is finished, it is restarted again. In general the repeat rate is 30 times per second, corresponding to a frame rate fast enough for our human eyes not to see the flickering.
Processing is a language that is built on top of another language: Java. Java is compatible with all three major operating systems (Windows, OS X, or Linux), and is free. Java is also superior for its graphing abilities. All these properties made it a good support language for Fry and Reas to pick when they wanted to create Processing.
Where does a Processing Program actually run?
The short answer: on your computer! If you are looking at a Processing applet that is running on a Web site, then the applet is downloaded first by the browser, and run inside the browser. If you are running a Processing program that you just created with the Processing editor, then it's also running on your computer. Because it is running on your computer, it can easily perform many useful tasks for programmers:
- Get characters typed at the keyboard
- Listen to what the mouse is doing, including changing its position, or whether buttons are pushed, clicked, or released.
- Display graphic shapes on the display window
- Play sound files (e.g. MP3 files)
- Play video files
- etc... (see the exhibition page on Processing for additional examples of interactions).
Writing a Processing Program
First we need to download and install Processing on our computer. See the Processng Download page for more information.
Next we start the Integrated Development Environment tool (IDE), which is a fancy word for editor, and we enter programs.
Running a Processing Program
This part is simple, just click on the round button with a triangle in it, at the top left of the IDE, and this should start the program.
Online Resources
Best Resource
- Processing.org: the Web site for Processing is probably the best place to find information, and to find the language environment which you can download for free.
- Processing.org/learning: good place to start learning Processing, or reviewing concepts seen in class.
- Processing.org/learning/overview: Just what the name says; it's an overview of the language with simple examples.
Searching by yourself
There is a wealth of Web resources on processing. Unfortunately, when you search for processing on Google (or your favorite search engine), you may get results unrelated to the language Processing, but to the word processing. A good way to force Google to return results that are relevant to the language is to search for processing.org, which is the Web site for Processing.
Misc. Videos
|
This is less about Processing than about data visualization, and how Ben Fry, one of the co-authors of Processing uses the language to represent data. Several of his projects are presented.
|
- Jose Sanchez's list of video tutorials
References
- ↑ C. Reas, B. Fry, Processing: programming for the media arts, AI & Soc (2006) 20: 526–538 DOI 10.1007/s00146-006-0050-9, (http://hlt.media.mit.edu/dfe_readings/processing.pdf)