Book Image

Processing 2: Creative Programming Cookbook

Book Image

Processing 2: Creative Programming Cookbook

Overview of this book

Processing is probably the best known creative coding environment that helps you bridge the gap between programming and art. It enables designers, artists, architects, students and many others to explore graphics programming and computational art in an easy way, thus helping you boost your creativity. "Processing 2: Creative Programming Cookbook" will guide you to explore and experience the open source Processing language and environment, helping you discover advanced features and exciting possibilities with this programming environment like never before. You'll learn the basics of 2D and 3D graphics programming, and then quickly move up to advanced topics such as audio and video visualization, computer vision, and much more with this comprehensive guide. Since its birth in 2001, Processing has grown a lot. What started out as a project by Ben Fry and Casey Reas has now become a widely used graphics programming language. Processing 2 has a lot of new and exciting features. This cookbook will guide you to explore the completely new and cool graphics engine and video library. Using the recipes in this cookbook, you will be able to build interactive art for desktop computers, Internet, and even Android devices! You don't even have to use a keyboard or mouse to interact with the art you make. The book's next-gen technologies will teach you how to design interactions with a webcam or a microphone! Isn't that amazing? "Processing 2: Creative Programming Cookbook" will guide you to explore the Processing language and environment using practical and useful recipes.
Table of Contents (18 chapters)
Processing 2: Creative Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Index

A

  • abs() function
    • about /
    /
  • accelerationEvent() function / How to do it..., How it works...
  • accelerometer
    • about /
    • using / Using the accelerometer, How to do it...
    • working / How it works...
  • AccelerometerManager class / How it works...
  • add() method /
  • ambientLight() function /
  • Android
    • 3D sketches, creating / Creating 3D sketches on Android, How it works...
  • Android App
    • icon, adding / Adding an icon to your Android App, How to do it..., How it works...
  • Android device
    • sketch, running / Running your sketch on an Android device, How to do it..., How it works...
    • working / How it works...
  • Android Emulator
    • about /
    • sketch, running /
    • working /
  • Android mode
    • about /
    • screen size and density, accessing / Accessing screen size and density, How to do it...
    • touch interaction, responding / Responding to touch interaction, How to do it..., How it works...
    • accelerometer, using / Using the accelerometer, How to do it...
    • GPS, using / Using the GPS, How to do it...
  • Android Network Location Provider
    • about / There's more...
  • Android SDK
    • installing /
    • downloading /
    • using /
    • working /
  • Android UI Guidelines
    • URL / How it works...
  • append() function /
  • applications
    • exporting /
  • arrayCopy() function /
  • ArrayList data structure
    • about /
  • ArrayLists
    • working with /
  • arrays
    • working with /
  • audio, working with
    • live audio, using /
    • waveform, drawing /
    • FFT, using /
    • audio reactive particles /
    • drum machine, creating /
    • synthesizer, creating /
    • effects, using /
  • audio files
    • playing /
    • working /
  • AudioInput object /
  • AudioPlayer object /
  • audio reactive particles
    • about /
    • working /
  • AudioSample class /

B

  • background() function /
  • bandpass filter /
  • basic shapes
    • drawing /
  • Beads
    • URL /
  • beginRaw() function /
  • beginRecord() function /
  • beginShape() function /
  • bezier() function /
  • bezierDetail() function /
  • bezierPoint() function /
  • bezierVertex() function /
  • binary() function /
  • binary files
    • saving /
  • blend() function
    • about /
  • blob tracking
    • about /
    • working /
  • blue() function /
  • blur() method /
  • boolean() function /
  • boolean variable /
  • bottomRightX
    • about /
  • bottomRightY
    • about /
  • box() function /
  • brightness() function /
  • brightness() method /
  • bufferSize() method /
  • byte() function /

C

  • <canvas> tag /
  • camera() function /
  • Capture() function
    • about /
  • Capture.list() method
    • about /
  • captureEvent() function
    • about /
  • ceil() function
    • about /
  • char() function /
  • charAt() method /
  • close() method /
  • color() function /
  • colorMode() function /
  • colors
    • working with /
  • Color Selector tool
    • about / Writing Processing tools
  • color tracking
    • about /
    • working /
  • color variable /
  • concat() function /
  • containsKey() method /
  • containsPoint() method /
  • contrast() method /
  • coordinate system
    • about /
    • working /
  • copyHeight variable /
  • copyWidth variable /
  • createGraphics() function /
  • createWriter() function /
  • CSV
    • about /
    • parsing /
  • curve() function /
  • curveDetail() function /
  • curvePoint() function /
  • curves
    • drawing /
  • curveTightness() function /
  • curveVertex() function /
  • custom HTML template
    • creating /
    • working /
    • variables /
  • custom shapes
    • drawing /

D

  • 2D and 3D objects
    • mixing /
  • 3D camera
    • using /
    • working /
  • 3D files
    • exporting /
  • 3D primitives
    • drawing /
    • working /
  • 3D scene
    • lights, using /
  • 3D shapes
    • polygon soup, making /
  • 3D sketches
    • creating, for web /
    • creating, on Android / Creating 3D sketches on Android, How it works...
  • 3D space
    • about /
    • enabling /
  • @@description@@ variable
    • about /
  • datatypes
    • converting /
  • ddf.minim.*
    • about /
  • ddf.minim.analysis.*
    • about /
  • ddf.minim.effects.*
    • about /
  • ddf.minim.signals.*
    • about /
  • degrees() function /
  • directionalLight() function /
  • disableStyle() method /
  • DisplayMetrics class / How it works...
  • dist() function
    • about /
    /
  • document.getElementById() function /
  • draw() function
    • about /
    /
  • drawGrid() function /
  • drum machine
    • creating /
    • working /
  • duration() method
    • about /

E

  • Eclipse
    • installing / Installing Eclipse, How to do it...
    • downloading / Getting ready
    • working / How it works...
    • Processing plugin, installing / Installing the Processing plugin for Eclipse
    • Processing library template, installing / Installing the Processing library template in Eclipse
    • Processing tool template, installing / Installing the Processing tool template
  • editor.setText() method / How it works...
  • effects
    • using, in audio /
    • working /
  • ellipse() function /
  • Embedded Systems(ES) /
  • enableStyle() method
    • about /
  • endRaw() function /
  • endRecord() function /
  • endShape() function /
  • equals() function /
  • Ess
    • URL /
  • event.getPointerCount() method / There's more...
  • exit() function
    • about /
  • expand() function /

F

  • face detection
    • OpenCV used /
  • FFT
    • using /
    • working /
  • fft.getBand() method /
  • fft.specSize() method /
  • fft buffer /
  • fill() function /
  • filter() function
    • about /
    • modes /
  • filters
    • using, in video /
  • float() function /
  • float variable /
  • floor() function
    • about /
  • flush() method /
  • fonts
    • working with /
  • for loop
    • about /
  • frameRate() function /
    • about /

G

  • get() method /
  • getAction() method / How it works...
  • getChild() method
    • about /
  • getContent() function /
  • getInt() function /
  • getLineIn() method /
  • getMenuTitle() method / How it works...
  • getName() function /
  • getString() function /
  • gfx.polygon2D() method /
  • GitHub /
  • GPS
    • about /
    • using / Using the GPS, How to do it...
    • working / How it works...
  • GPSLocationListener class / How it works...
  • graphical user interface (GUI) /
  • green() function /

H

  • @@height@@ variable
    • about /
  • HashMaps
    • working with /
  • hasNext() method /
  • hex() function /
  • highpass filter /

I

  • @@id@@ variable
    • about /
  • icon
    • adding, to Android App / Adding an icon to your Android App, How to do it..., How it works...
  • image() function /
    • about /
  • images
    • working with /
    • saving /
  • images/SVG files
    • working with /
  • image sequences
    • exporting /
  • indexOf() method /
  • init() method / How it works...
  • Inkscape
    • about /
    • URL /
  • int() function /
  • Integer class /
  • IntelliJ IDEA
    • about / Using Processing with IntelliJ IDEA
    • Processing, using with / Using Processing with IntelliJ IDEA
    • used, for creating Processing sketches / Using Processing with IntelliJ IDEA
    • working / How it works...
  • isEmpty() method /
  • iterator() method /

J

  • JavaScript
    • used, for writing sketches /
  • JavaScript mode
    • about /
    • exploring /
  • join() function /
  • jQuery
    • using, with Processing.js /
  • jump() method
    • about /

K

  • keyPressed() function
    • about /
    /
  • keyReleased() function
    • about /
  • keyTyped() function
    • about /

L

  • League of Moveable Type
    • downloading / Getting ready
  • length() method /
  • lerpColor() function
    • about /
  • libraries
    • installing /
  • Library Manager
    • about /
  • lights
    • using, in 3D scene /
    • working /
  • line() function
    • about /
  • Linux
    • Processing, installing /
  • live audio
    • using /
  • loadBytes() function /
  • loadFont() function /
  • loadImage() function /
  • loadPixels() function
    • about /
  • loadShape() function /
  • loadStrings() function /
  • loadXML() function /
  • localhost /
  • LocationListener interface
    • about / How it works...
    • onLocationChanged() method / How it works...
    • onProviderDisabled() method / How it works...
    • onProviderEnabled() method / How it works...
    • onStatusChanged() method / How it works...
  • loop() method
    • about /
  • lowpass filter /

M

  • Mac OS X
    • Processing, installing /
  • mage() function
    • about /
  • map() function /
  • math functions
    • using /
    • println() function /
    • abs() /
    • ceil() /
    • floor() /
    • round() /
    • min() /
    • max() /
    • sq() /
    • sqrt() /
    • dist() /
  • max() function
    • about /
  • maxColorDifference variable /
  • min() function
    • about /
    /
  • Minim
    • about /
  • minim.getLineIn() method /
  • Minim library
    • Sonia /
    • Beads /
    • Ess /
    • importing /
    • ddf.minim.* /
    • ddf.minim.signals.* /
    • ddf.minim.analysis.* /
    • ddf.minim.effects.* /
  • Mobile Processing
    • about /
  • modes, filter() function
    • BLUR /
    • DILATE /
    • ERODE /
    • GRAY /
    • INVERT /
    • OPAQUE /
    • POSTERIZE /
    • THRESHOLD /
  • modes, Processing
    • switching /
    • Standard mode /
    • JavaScript mode /
    • Android mode /
  • MotionEvent class / How it works...
  • motionPressure variable / How it works...
  • mouseButton system variable
    • about /
  • mouseClicked() function
    • about /
  • mouseDragged() function
    • about /
  • mouseMoved() function
    • about /
    /
  • mousePressed() function
    • about /
    /
  • mousePressed system variable
    • about /
  • mouseReleased() function
    • about /
  • mouseX system variable
    • about /
  • mouseY system variable
    • about /
  • movieEvent() function
    • about /
  • MyObject class /
  • mySketch() function /
  • my_first_sketch
    • creating /
    • working /

N

  • new Movie() method
    • about /
  • next() method /
  • noFill() function /
  • noLights() function /
  • noLoop() function /
  • NORMALIZED texture mode /
  • noStroke() function /
  • notch filter /
  • numPixels variable /

O

  • onLocationChanged() method
    • about / How it works...
  • onPause() function / How to do it...
  • onProviderDisabled() method
    • about / How it works...
  • onProviderEnabled() method
    • about / How it works...
  • onResume() function / How to do it..., How it works...
  • onStatusChanged() method
    • about / How it works...
  • OpenCV
    • about /
    • used, for accessing webcam /
    • used, for face detection /
    • ROI, defining with /
    • video, manipulating with /
  • OpenCV library
    • installing /
    • working /
  • OPENGL parameter /

P

  • PApplet object
    • about /
  • PDE
    • about /
    • exploring /
    • working /
  • PDF files
    • saving /
  • PDF sizes
    • calculating /
  • PeasyCam library /
  • pg.beginDraw() /
  • PGraphics object /
  • PImage object /
  • pixelMode /
  • pixels
    • manipulating, in video /
  • play() method /
  • player.addEffect() method /
  • player.isPlaying() method /
  • player.length() method /
  • player.loop() method /
  • player.pause() method /
  • player.play() method /
  • player.position() method /
  • player.rewind() method /
  • pmouseX system variable
    • about /
  • pmouseY system variable
    • about /
  • point() function
    • about /
  • pointLight() function /
  • points
    • calculating, on curve /
  • Polygon2D constructor /
  • polygon soup
    • making /
    • working /
  • popMatrix() function /
  • popStyle() method /
  • position() method /
  • pressButton() method /
  • println() function
    • about /
    /
  • Processing
    • about /
    • installing /
    • for Windows /
    • for Mac OS X /
    • for Linux /
    • working /
    • Sketchbook /
    • modes, switching /
    • coordinate system /
    • math functions, using /
    • mouse interaction, tracking /
    • keyboard interaction, tracking /
    • basic shapes, drawing /
    • colors, working with /
    • images, working with /
    • text, drawing /
    • curves, drawing /
    • points, calculating on curve /
    • custom shapes, drawing /
    • SVG files, manipulating /
    • offscreen drawing /
    • exporting from /
    • images, saving /
    • applications, exporting /
    • PDF files, saving /
    • PDF sizes, calculating /
    • text files, exporting /
    • 3D files, exporting /
    • binary files, saving /
    • video, playing /
    • audio, working with /
    • webcam, using /
    • video, thresholding /
    • blob tracking /
    • color tracking /
    • OpenCV library, installing /
    • webcam, accessing with OpenCV /
    • face detection, with OpenCV /
    • ROI, defining with OpenCV /
    • video, manipulating with OpenCV /
    • custom HTML template, creating /
    • fonts, working with /
    • images/SVG files, working with /
    • 3D sketches, creating /
    • sketches, writing with JavaScript /
    • using, with IntelliJ IDEA / Getting ready, How to do it...
  • processing.draw = function(){} line /
  • Processing.js
    • URL /
    • using, without Processing editor /
    • downloading /
    • using, with jQuery /
  • processing.setup() = function(){} /
  • Processing 2
    • about /
    • downloading /
  • Processing functions
    • drawGrid() function /
    • about /
    • rect() function /
    • ellipse() function /
    • triangle() function /
    • quad() /
  • Processing libraries
    • writing / Writing Processing libraries, How to do it...
    • working / How it works...
  • Processing library template
    • installing, in Eclipse / Installing the Processing library template in Eclipse, How to do it...
    • downloading / Getting ready
    • working / How it works...
  • Processing plugin
    • installing, for Eclipse / Installing the Processing plugin for Eclipse, How to do it..., There's more…
    • first sketch, writing / Write your first sketch with the Processing Eclipse plugin, How to do it..., How it works...
  • Processing sketch
    • creating /
    • creating, for web /
    • running, in JAVASCRIPT mode /
    • running, in Android Emulator /
    • running, on Android device / Running your sketch on an Android device, How to do it..., How it works...
  • Processing tools
    • writing / Writing Processing tools, How to do it...
    • working / How it works...
  • Processing tool template
    • installing / Installing the Processing tool template, How to do it...
    • downloading / Getting ready
    • working / How it works...
  • pushMatrix() function /
  • pushStyle() method /
  • put() method /

Q

  • quad() /
  • quad strips
    • about /
    • drawing /
  • QUAD_STRIP parameter /

R

  • radians() function /
  • read() method
    • about /
  • rect() function /
  • remove() method /
  • render() method /
  • reverse() function /
  • RGB and HSB color modes
    • using /
  • RGB color mode /
  • ROI
    • about /
    • setting, OpenCV used /
    • working /
  • ROI() method /
  • rotateY() function /
  • round() function
    • about /
  • run() method / How it works...

S

  • @@scripts@@ variable
    • about /
  • @@sketch@@ variable
    • about /
  • @@source@@ variable
    • about /
  • saveBytes() function /
  • saveBytes() method /
  • saveFrame() function /
    • about /
  • savePDF variable /
  • screen size and density
    • accessing / Accessing screen size and density, How to do it...
  • setup() function
    • about /
    /
  • shape() function /
  • size() function /
    • about /
  • size() method /
  • Sketchbook
    • about /
  • sketches
    • writing, with JavaScript /
  • sketchHeight() function
    • about / How it works...
  • Sketchpad
    • about /
    • URL /
  • sketchRenderer() function
    • about / How it works...
  • sketchWidth() function
    • about / How it works...
  • smooth() function
    • about /
  • snowFlake variable /
  • Software Development Kit (SDK) /
  • Sonia
    • URL /
  • sort() function /
  • specific frame, video
    • jumping to /
  • speed() method
    • about /
  • speed, of video
    • controlling /
  • sphere() function /
  • sphereDetail() function /
  • split() function /
  • spotLight() function /
  • sq() function
    • about /
  • sqrt() function
    • about /
  • Standard mode
    • about /
  • STANDARD mode Processing sketches /
  • start() method
    • about /
  • stop() function /
  • str() function /
  • Strings
    • working with /
  • stroke() function /
  • strokeWeight() function
    • about /
  • subset() function /
  • substring() method /
  • super.surfaceTouchEvent() method / How it works...
  • superArray /
  • surfaceTouchevent() method / How to do it..., How it works...
  • SVG files
    • manipulating /
  • synthesizer
    • creating /
    • working /

T

  • text
    • drawing /
  • text() function /
    • about /
  • textAlign() function /
  • textAscent() function /
  • textDescent() function /
  • textFile.println() method /
  • text files
    • loading, from hard drive /
    • exporting /
  • textFont() function /
  • textLeading() function /
  • texture() function /
  • textureMode() function /
  • textures
    • using /
    • working /
  • textWidth() function /
  • time() method
    • about /
  • toLowerCase() method /
  • Tool Manager
    • about /
  • tools
    • installing /
    • working /
  • topLeftX variable /
  • topLeftY variable /
  • touch interaction
    • responding to / Responding to touch interaction, How to do it...
  • toUpperCase() method /
  • Toxiclibs
    • about /
    • downloading /
    • working /
  • translate() function /
  • triangle() function /
  • triangle strips
    • about /
    • drawing /
  • TRIANGLE_STRIP parameter /
  • trigger() method /
  • trim() function /

U

  • unbinary() function /
  • unhex() function /
  • update() method /
  • updatePixels() function
    • about /

V

  • .vlw file format /
  • variables, HTML template
    • @@scripts@@ /
    • @@sketch@@ /
    • @@source@@ /
    • @@id@@ /
    • @@width@@ /
    • @@height@@ /
    • @@description@@ /
  • Vec2D array /
  • Vec2D class /
  • vertex() function /
  • video
    • playing /
    • blending /
    • thresholding /
    • manipulating, OpenCV used /
  • video, creating
    • image sequences, exporting /
    • pixels, manipulating /
    • filters, using /
    • speed, controlling /
    • specific frame, jumping to /

W

  • @@width@@ variable
    • about /
  • wave.setFreq() method /
  • waveform
    • drawing /
    • working /
  • webcam
    • using /
    • working /
    • accessing, OpenCV used /
  • webcam.available() method /
    • about /
  • webcam.read() method
    • about /

X

  • XML
    • about /
    • parsing /
  • xml.getString() method /