1 / 15

Processing processing/ MIT Media Lab

Processing http://processing.org/ 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.

drucker
Download Presentation

Processing processing/ MIT Media Lab

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Processinghttp://processing.org/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.

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

  3. 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).

  4. Coding float xCoor = 0; float yCoor = 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 xCoor= xCoor+ speed; // Change x location if (xCoor> width) { // Reset if it runs of the screen. xCoor= 0; } fill(0); // Paint a rectangle rect(xCoor,yCoor,30,10); }

  5. 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’.

  6. Eclipse There is an Eclipse plugin: http://wiki.processing.org/w/Eclipse_Plug_In However, you can write just as well without it: http://processing.org/learning/eclipse/

  7. 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. http://forum.processing.org/topic/reserved-keywords-wiki-page If you separate classes into 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.

  8. Other versions: add modes 1.5 rather nicely generates a webpage for you with the source code and an applet version embedded in it. Version 2 allows you to generate a Javascript version (version 3 allows you to write in p5, a javascript for Processing). Unfortunately this is doesn’t work well with libraries, so you may want 1.5 for web work. Also Android and Python options.

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

  10. Arduino https://www.arduino.cc/ Analogue pins (read/write levels between 0 and 1024) Digital pins (read/write high/low) Two way serial communication.

  11. Arduino Simple C-based language. https://www.arduino.cc/en/Reference/HomePage int inPin = 0; void setup() { Serial.begin(9600); } void loop() { Serial.println(analogRead(inPin)); delay(10); }

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

  13. Visualisation inspiration http://visual.ly/ http://www.visualisingdata.com/ Books: JFreeChart developer guide. Processor books (see website) Visualisation books by Edward Tufte

  14. Next Lecture Libraries II: Scientific libraries Practical JFreeChart Processing

More Related