Tag Archives: processing

Keyboard interaction

Making my way through the Keyboard interaction recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned about using keyPressed, keyReleased and keyTyped functions to assign keys on the keyboard to execute code and also a bit more about if tests and declaring variables, particularly changing their values when specified keys are pressed.

ch01_rec10_keyboard

Mouse interaction

Making my way through the Mouse interaction recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned about the mouseClicked, mouseDragged, mouseMoved, mousePressed and mouseReleased functions. I also learned about the mouseX, mouseY, pmouseX, pmouseY, mousePressed and mouseButton variable. The mouseButton variable allows you to determine if the left, right or middle mouse button has been clicked. This recipe is also the first time an if test has been used. They’re cool. I know I’ll be using them heavily to determine the display or actions in future sketches.

Screen Shot 2014-01-25 at 10.58.01 PM

Maths functions

Making my way through the Maths functions recipe from the Processing 2 Creative programming cookbook source code on GitHub. In this recipe I learned about declaring variables and the abs, ceil, floor, round, sq, sqrt, min, max, and dist functions. I also learned how to use the println function to display output of functions to the Processing console window. Good for debugging a Sketch!

Screen Shot 2014-01-25 at 9.39.17 PM

For this recipe the Processing window displayed at runtime isn’t used, but I still wanted to use the size() function.

Using a for loop to draw lines

I wanted to draw a grid. Previously, I specified each horizontal and vertical line in my sketch. Totally boring, inefficient and completely inflexible way to draw repetitive lines. So, I checked out the Processing reference on for loops and then applied that methodology to my existing sketch. Tight!
Screen Shot 2014-01-24 at 11.48.33 PM

This could be the method to use to draw a grid for the Design or Sew sections of the Sew, grow and mow: An AR lawn art experience.

Prototyping AR with processing and blender

I’m interested in exploring the use of augmented reality (AR) in learning experiences.  I’ve decided to prototype my early simple AR experiments with Processing and Blender. These early explorations will make use of augments placed with fiducial markers. My goal is to then explore developing AR learning experiences with Layar that can then be viewed through iOS and Android mobile devices. I’d then like to explore placing augments without using fiducial markers. These augment could be determined by location. One step at a time.

I used Processing, Blender and NyARToolkit to create this very simple zombie wound augment. This needs a bit more work as the augment is displaying bounding box information and the low-poly modelling is not as smooth as it should be. The augment could be made to look a little more integrated with my body with improved modelling and texturing. That will come with the next iteration.