GeoComputing.co.uk logo

Quick links:

Home

PDA projects

Geophysics

Positioning

Virtual Reality

Robotics

Processing

Arduino

Galleries

Miscellaneous

Tech News

New pages

GeoTweet

FizzPop and Processing

An introduction to 2D graphics and animation in Processing.

 

This short but fun applet was written for the FizzPop hacker space Processing show'n'tell beginners programming evening held in June 2010 in Birmingham. It illustrates how to load and draw 2D graphics files, including how to rotate, scale and position them, plus transparency (alpha) setting. It also has keyboard controls: left/right make the dog change direction, up/down make the cogs rotate quicker/slower, and 'r' makes the whole thing start over. In the full version of the code below, you can also use the 'f' key at any time to save a graphics file of the applet window.

 

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

 

The code, which you can download here, has been heavily commented, so hopefully it will make sense after a bit of reading (and of course it's easier if you've been to the FizzPop Processing evening too). There are seven graphics files that are needed for the code to work properly, and you can download them using the links below. You need to save them to a folder called 'data' in the same place that you have the downloaded Processing code file (fizzpop.pde). In fact, you may find the code runs OK if you save these files to the same folder as the code, but be warned that when you export an applet graphics files may be ignored if not in the correct place! All of them are GIF files and a colour has been set as the palette transparency, which makes life much easier when animating images in Processing. Also, the same colour was then used as the background colour for the Processing window which, although not absolutely necessary, does help avoid aliasing around the edge of the images and so makes everything look a bit more professional. By the way, the graphics are based on ones provided by Antonio at HelloCatfood, so please pop along to his website to see his creations.

Bottom cog, top cog, dog left, dog right, fizz, p, smile.

Finally, happy FizzPop Processing!

 

This page created May 2010 - Last updated May 2010

Website copyright A Thomas 2009-2010

No part of this site shall be reproduced, downloaded or otherwise taken from the site without the permission of the copyright owner. Use of this site is at your own risk. No guarantee is provided as to the accuracy of any content displayed on this web site. Unresolved disputes will be settled in an English court.