Processing Dr Andy Evans. Processing MIT Media Lab Libraries for visualisation. Wraps a simple visualisation scripting language.

Slides:



Advertisements
Similar presentations
Objects. 2 Object Oriented Programming (OOP) OOP is a different way to view programming Models the real world A different view than Structured programming.
Advertisements

Processing and Java David Meredith
Made with love, by Zachary Langley Applets The Graphics Presentation.
Lecture 2 Internet Computing Using Java Theophano Mitsa UMASS-Dartmouth.
Introducing Java CSC1401. Course Goals Teaching programming concepts In a “real” language.
Processing Lecture. 1 What is processing?
PHY-102 SAPIntroductory GraphicsSlide 1 Introductory Graphics In this section we will learn how about how to draw graphics on the screen in Java:  Drawing.
Emerging Platform#5: Processing 2 B. Ramamurthy 6/13/2014B. Ramamurthy, CS6511.
Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
CompSci Applets & Video Games. CompSci Applets & Video Games The Plan  Applets  Demo on making and running a simple applet from scratch.
Processing Processing is a simple programming environment that was created to make it easier to develop visually oriented applications with an emphasis.
1 Frameworks. 2 Framework Set of cooperating classes/interfaces –Structure essential mechanisms of a problem domain –Programmer can extend framework classes,
Applets. An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from a browser You.
26-Jun-15 Applets. 2 An applet is a Panel that allows interaction with a Java program A applet is typically embedded in a Web page and can be run from.
28-Jun-15 Applets. 2 An applet is a program that is typically embedded in a Web page and can be run from a browser You need special HTML in the Web page.
Java Quick & Dirty By Bert Wachsmuth. Overview  We will cover: What is Java Using and Writing Java applets Getting more information  We will need: Knowledge.
Writing Methods. Create the method Methods, like functions, do something They contain the code that performs the job Methods have two parts.
Programming for Geographical Information Analysis: Advanced Skills Lecture 7: Libraries I: Visualisation Dr Andy Evans.
Developing User Interfaces (DUI) Chris North cs3724: HCI.
Chien-Chung Shen Manifest and Activity Chien-Chung Shen
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
Classes / Objects An introduction to object-oriented programming.
11 Getting Started with C# Chapter Objectives You will be able to: 1. Say in general terms how C# differs from C. 2. Create, compile, and run a.
Applets & Video Games 1 Last Edited 1/10/04CPS4: Java for Video Games Applets &
Copyright© Jeffrey Jongko, Ateneo de Manila University Android.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
Java Lecture 16: Dolores Zage. WWW n Was a method for distributing passive information n added forms and image maps n interaction was only a new way to.
DUE Hello World on the Android Platform.
JAPPLET.
Learn about the types of Graphics that are available Develop a basic Graphics applet Develop a basic Graphics application Review the Java API and use.
Processing.js.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
Introduction to Processing CS 4390/5390 Fall 2014 Shirley Moore, Instructor September 3,
Copyright © Curt Hill Turtles The beginning of media computation.
1 Web Based Programming Section 8 James King 12 August 2003.
Program that runs in appletviewer (test utility for applets) Web browser (IE, Communicator) Executes when HTML (Hypertext Markup Language) document containing.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
Installing Repast in the Eclipse IDE Charlie Gieseler 6/28/04.
Introduction to Processing. 2 What is processing? A simple programming environment that was created to make it easier to develop visually oriented applications.
Introduction to JavaScript CS101 Introduction to Computing.
1 Taif University Faculty Of Computers And Information Technology TA. Kholood Alharthi & TA. Maha Thafar First Semester AH.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
1 CSC 216 Lecture 3. 2 Unit Testing  The most basic kind of testing is called unit testing  Why is it called “unit” testing?  When should tests be.
CSC 520 – Advanced Object Oriented Programming, Fall, 2010 Thursday, October 14 Week 7, UML Diagrams
Computer Science Reaching Wider Summer School 2012.
CHAPTER Agenda Applets Servelets Browsers HelloWorld.
Client-Server applications Introduction to Java Applets Client-server architectures Why do Applets exist? What can an Applet do?
Arc: Communications between Addins Dr Andy Evans.
Processing == Java + Extra Utilities Processing Adds: – Drawing functions – Text and font manipulations – Image and video – 3D transformations – Keyboard.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Programming in Java Transitioning from Alice. Becomes not myFirstMethod but …. public static void main (String[] arg) { // code for testing classes goes.
Loops. About the Midterm Exam.. Exam on March 12 Monday (tentatively) Review on March 5.
Create a Halloween Computer Game in Scratch
Introduction to programming in java
Emerging Platform#1: Processing 3
Flash Interface, Commands and Functions
Programming for Geographical Information Analysis: Advanced Skills
Primitive Data, Variables, Loops (Maybe)
Installing and running the local check projects in Eclipse
“Processing” easy coding Jens Dalsgaard Nielsen
Introduction to Algorithm Design
Lecture 7: Introduction to Processing
Java Tutorial – Application Building
Developing Java Applications with NetBeans
Developing Java Applications with NetBeans
Working with Libraries
The beginning of media computation Followed by a demo
Presentation transcript:

Processing Dr Andy Evans

Processing MIT Media Lab Libraries for visualisation. Wraps a simple visualisation scripting language inside java classes. Also javascript /Android / iPhone javascript versions. Excellent community with a positive attitude to open sourcing good code.

Processing Development Environment Small put perfectly formed IDE. Saves as Applications, MPEG, SVG and PDFs. Bundles everything (data, libraries) into jars. Constructs executables.

Coding Two important methods: void setup(){ } Runs once at start. void draw(){} Runs each frame until stopped (60 frames s -1 ; but can be changed).

Coding float x = 0; float y = 100; float speed = 1; void setup() { size(200,200);// Size has to be first thing in setup } void draw() { background(255);// Wipe the background white x = x + speed;// Change x location if (x > width) {// Reset if it runs of the screen. x = 0; } fill(0);// Paint a rectangle rect(x,y,30,10); }

Objects In the PDE you can put code in different tabs. However, you can also just put multiple classes in one tab. Processing will wrap them all inside its own class, as ‘inner classes’.

Java development Extend the Processing wrapper PApplet. Add in your Processing code. If you want it to run as an application, add: public static void main(String args[]) { PApplet.main(new String[] { "--present", "MyProcessingSketch“ }); } For multiple classes you need to get a reference to the Papplet class into your class then call, e.g. papplet.draw();

Eclipse There is an Eclipse plugin: However, you can write just as well without it: If you run as an applet in Eclipse and want to run as an application, go into File -> Properties and delete the Launch Configuration or use the arrow on the run button to “Run As”.

Processing tips Processing creates a project ‘sketchbook’ directory called after the main file for each project. It expects to find all data in a data directory in here. Libraries should also be in a ‘libraries’ directory, though better to just ‘Add File’ them. Avoid variable names it might already use, like pixels, x, y, and z. If you separate classes in to other files, call them, e.g. “Car” rather than “Car.java” – the latter signals that Processing should treat it as Java, and you’ll need to import the classes etc.

Other Processing Libraries for: XML / GPS interaction / Network communications Connections with Ruby/Python/Javascript Video / Sound Communications with hardware Webcam and motion recognition Spinoff projects: Wiring/ Arduino – chipboards for hardware development

Book Great book on processing, but also modelling real systems more generally, is:

Visualisation inspiration Books: JFreeChart developer guide. Processor books (see website) Visualisation books by Edward Tufte