www.Linux-Support.com

  • Increase font size
  • Default font size
  • Decrease font size
Home

Processing - Animation in Java

Print
Article Index
1. What is Processing?
2. The Core API
3. Extending Processing
4. Examples
4.1. Arrays and Points
4.2. Lens Effect
4.3. Sine and Cosine

web-cacheProcessing is a powerful programing language, development environment and runtime environment implemented in Java. Applications and animations implemented in Processing are running typically in web browsers, but they are not limited to this area of application. Processing is an Open Source project.

This article introduces Processing and provides a quick overview of available interfaces, programming libraries and possible areas of application.

1. What is Processing?

Processing is a programming language, development environment, and online community that since 2001 has promoted software literacy within the visual arts. Initially created to serve as a software sketchbook and to teach fundamentals of computer programming within a visual context, Processing quickly developed into a tool for creating finished professional work as well.

Tens of thousands of companies, artists, designers, architects, and researchers use Processing to create an incredibly diverse range of projects.

The Processing community has written over seventy libraries to facilitate computer vision, data visualization, music, networking, and electronics.

The Processing software runs on the Mac, Windows, and GNU/Linux platforms. With the click of a button, it exports applets for the Web or standalone applications for Mac, Windows, and GNU/Linux. Graphics from Processing programs may also be exported as PDF, DXF, or TIFF files and many other file formats.

Processing provides an own programming language, interpreted by the Java VM. The interpreter of Processing has a small footprint, so you are able to integrate your applications in Java web applets with ease. Beside this field of application Processing may be integrated in AWT, Swing and SWT, too.

2. The Core API

The core API of Processing provides a rich set of commands. Beside all important constructs reqiured implement loops, conditional statements and a set of data types and arrays the following topics can be found:

  • 2d / 3d primitives
  • curves (by bezier, points, tangents, ...)
  • vertexes
  • Input (mouse and key events)
  • read data from files and network
  • save (generated) images and write data to files
  • 2d / 3d transformations
  • lights and cameras
  • pixel based operations
  • working with (external) fonts
  • math library

3. Extending Processing

There are a number of additional libraries available to extend the feature list of Processing.The following topics can be found in the long list of extensions:

  • Audio
  • DXF Export
  • JavaScript - interfacing between JavaScript and Java Applets.
  • Network
  • OpenGL
  • PDF Export
  • Serial
  • SVG Export
  • Video
  • XML Import

For a detailed list of libraries take a look into the list of references at the end of the article.

Since the inclusion of extentions is quite simple and you are able to write your own functions in Java and the programming language integrated in Processing, you should be able to get impressive results within several hours.

4. Examples

4.1. Arrays and Points

The first example is a non-interactive one that demonstrates how to use arrays and how to set the stroke and color for single points of an image.

4.2. Lens Effect

This applet is demonstrating mathematical and image processing features of Processing. An image is loaded from server and the lens effect is generated at client side.

4.3. Sine and Cosine

A demonstration of simple mathematical functions. When combining this effects with loading of images, transformations and loops you will be able to generate eye-catching animations.

Related resources:

Last Updated on Sunday, 25 July 2010 22:06