View Quartz Composer with BBTouch

This article will show you how to get a simple single touch cursor functionality in Quartz Composer using BBTouch. This only works on Leopard.

1) Get and install Quartz Composer and Xcode

At the moment I assume you already have quartz composer, it’s included with the developer DVD and available as a free download from apple. Check here for more info.

2) Get and install TUIO plugin
Download the Tuio_Quartz package from the reacTIVision software page:

Unpack the archive and copy TuioClient.plugin to /Library/Graphics/Quartz Composer Plug-Ins

If you have already put a patch called TuioClient.plugin and put it in /Library/Graphics/Patches, delete it.

3) Get and install BBTouch from the googlecode project.

Download the latest version in the googlecode list, or compile it yourself from source. If you download the source, don’t worry about anything except BBTouch.

4) Load and go!

Open BBtouch, configure it so that you are getting nice consistent blobs in the right window. If you are using a MTMini then make sure the box called “Find Dark Blob’s is checked.

BBTouchScreenshot.png

Open Quartz Composer and make a new blank composition.

From your patch creator, first put in a TuioClient. Then drop in a Structure Index Member. Connect the “cursors” of the TuioClient to “structure” of the Structure Index Member.

Find a Structure Key Member and drop 2 of those in your comp, one for the x-position and one for the y-position.

In one of the Structure Key Member patches, for the Input Paramaters type in xpos.

In the other Structure Key Member patch, for the Input Paramaters type in ypos.

Connect “member” from the Structure Index Member to “structure” of each Structure Key Member.

Now load a renderer, the teapot seems to be popular put a picture attached to a billboard works great too. Let’s just go with teapot. Drop the teapot patch in.

Change the teapot scale to .25. Attach the “member” from your xpos Structure Key Member patch to the “X Position” of the teapot. Do the same thing for your ypos, this time attaching to the “Y Position” of the teapot.

Assuming you have everything working, that should be it! The teapot will follow your blob, although it might need to be calibrated.