Ex Nihilo

A Processing Sketch Blog

« | »


It’s been more an issue of time restraints than lack of motivation that has kept me away from this blog over the past few months. Side projects here, trip around the world there, etc. etc.

To get back into my Processing exploration, I decided to formalize some of my most commonly-used functions into a single staring-point library/framework that I could build new sketches off of. Called ioLib, I’ve pushed it up to my ongoing gitHub repository of various sketches for anyone’s use. It’s not documented all that well, and as far as frameworks go I’d imagine there’s still a lot of work to be done toward making it self-contained, so I doubt it’ll be broadly applicable to people other than me. Maybe over time it’ll grow into something a bit more formal.

I tried to focus on some basic interactivity and output functions, stuff I find myself using over and over again. Straight from the README, this is what’s in it so far:

Bitmap and Vector Output

  • pressing ‘s’ saves a screencap as PNG
  • pressing ‘p’ saves a screencap as PDF
    • 3D mode is a bit quirky; the raw triangles are saved, even for 2D shapes. The background colour doesn’t save either.

2D / 3D Toggle

So far everything works with both 2D and 3D renderers, switching is a simple matter of adjusting the sceneDimensions variable in the user-configurable settings.

Palette Generation from Random Images

Any images (PNG, JPG or GIF) dropped into data/paletteSource will be used as input for the random palette generation function. The paletteCount variable in the user-configurable settings controls how large the palette will be.

Mouse and Keyboard Interaction

  • click and drag the mouse to rotate in 2D / 3D space
  • pressing ‘+’ zooms in, ‘-’ zooms out
  • arrow keys move the scene around
    • holding Shift increases the offset 10x
    • holding Ctrl increases the offset 100x
    • holding Ctrl + Shift increases the offset 1000x
  • pressing ‘c’ saves the palette
  • pressing ‘r’ resets the palette

Sunday, May 2nd, 2010 | Coding, Library, Projects | RSS 2.0

One Response to “ioLib”

  1. [...] « After putting ioLib out there a month or so back [...]

Leave a Reply

Powered by WP Hashcash