Archive for the 'Source code' Category

Adobe MAX Unconference files

As promised, here are the resources and source code from the Augmented Reality Unconference session I shared with Jesse Freeman.

You can download the source files here. One of the projects uses the native FP10 3D capabilities. The other uses Papervision with a 3D model exported from Blender as a Papervision class that extends TriangleMesh. Thanks to Lee Daley for the model. Both are FDT projects that make use of FLARManager.

Resouces.

FLARManager – Wrapper library by Eric Socolofsky.
Marker generator – Print out your marker and use this application to create the .pat file.
Blender – Free open source 3D software
Blender AS3 exporter plugin – This plugin allows you to export 3D models as AS3 classes. This works with Papervision, Sandy and Away.

AR Particle Beam

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to FurlAdd to Newsvine

So I thought it was about time I jumped on the augmented reality bandwagon. Rather than the obligitory 3D model I decided to make something a little different. I’ve used 3D lighting techniques and physics here to create this beam of light surrounded by strange celestial light particles.

If you would like to interact with it, first download and print out the marker here then go here for a live demo.

Big thanks to a few people. First and foremost Saqoosha, the clever chap who created the FLARToolkit library, a port of the C++ library ARToolkit. Mikko Haapoja for providing a fantastic introduction to using FLARToolkit. Eric Socolofsky for building the framework FLARManager which makes working with FLARToolkit a sinch.

Incidentaly while making this, John Lindquist started an augmented reality competition on the Papervision forum. I’ve decided to enter it (hence the Papervision Logo on my marker – rules of the comp, not sucking up) so please feel free to vote for me on the forum. :)

For those of you who are interested, you can download the source code here. It’s an FDT project but it shouldn’t be too difficult to convert it over to your favourite development environment.

2D Ribbons

2D Ribbons

I’ve been toying around with Eric Natzke’s Ribbon code and have managed to port it over to Processing in 2D form. Although the result and code are both very different to that of Natzke, it retains the original technique for building the ribbons. You can play with it and download the source here.

More ribbons can be added by changing the ribbonAmount variable. The colours are chosen from an image, in this case, “rothko_01.jpg”. This must be kept in the same folder as the pde files or there will be an error.

Motion Trails v01

This is the first experiment in a webcam study I am doing using Processing. Movement results in circles of colour taken from the webcam footage. More movement results in fewer, larger circles and vice versa.

Click here to see the video on Vimeo

Click here to download the source code

In order to use this code you need to install WinVDIG 1.01. This can be obtained from Dan Shiffman’s site. I would recommend a good quality webcam in a well lit room (I’m using the Logitech Quickcam Pro 5000). Also a powerful machine is required for the best results.

The FrameDifferencing code by Golan Levin was used as a basis for this sketch. This can be found in the Processing examples.

Arduino > Flash range sensor experiment

I’ve been playing around with the Arduino microcontroller recently and this is my first experiment. It’s a prototype for a future artwork that essentially acts as a primitive touchscreen device. I’ve used 2 PING))) Ultrasonic Range Sensors positioned at the top of my monitor. These measure the distance of any object placed in front of them. The Arduino board collects this data and passes it on to Flash via SerProxy.

Click here to see the video on Vimeo
Click here to see the video on YouTube

For this project I used a modified version of David Cuartielles’ Arduino sketch and SerProxy as a Serial-to-Network Proxy Server. Here is my serproxy.cfg code.


# Config file for serproxy
# See serproxy's README file for documentation

# Transform newlines coming from the serial port into nils
# true (e.g. if using Flash) or false
newlines_to_nils=true

# Comm ports used
comm_ports=3

# Default settings
comm_baud=9600
comm_databits=8
comm_stopbits=1
comm_parity=none

# Idle time out in seconds
timeout=300

# Port 3 settings (ttyS2)
net_port3=5333

I spent quite a lot of time trying to use Firmata, and AS3Glue but found that Firmata didn’t work with the PING Range Sensor. I’m fairly sure that AS3Glue requires the Board to be running Firmata so, as mentioned above, I settled for Arduino code from David Cuartielles. I wrote my own Actionscript to deal with the incoming data using the Socket and ByteArray classes. You can find an early rough version of this code here.

UPDATE:
Images of the setup can now be seen here.






Tweets