I've just uploaded v1.2 of ofxMSAPhysics, a traer-like particle/physics library for openFrameworks. Download can be found here and also needs the ObjC Pointer addon.
This is a demo of projection mapping with VDMX & Quartz Composer inspired by deepvisual's tutorial of doing it in modul8 (uk.youtube.com/watch?v=2bRfdn9lNO8).
VDMX unfortunately doesn't have this feature built-in, but fortunately has beautiful integration with Quartz Composer - allowing me to build a quad warper in QC using a GLSL vertex shader, which should be super fast.
Also, around the 4:30 mark you'll see me masking the video on the box in the back. This is also using a custom Quartz Composition which allows 4 point mask creation. Usage is almost identical to the QuadWarper, but instead of warping the image it just applies a mask, or you can invert the mask and it cuts a chunk out. You could do the same by creating new layers, grouping, using as a layer mask etc. but its a a bit more hassle I think. Using the QuadMask is a lot quicker and you can put multiple QuadMasks on the same layer to draw more complex masks.
Added loop mode configurable from the preferences.plist
-----------------
MSAQTPlayer is a Mega Super Awesome (& mega super basic), fullscreen / multiple output Quicktime player with fast, greater-than-4096-pixels support.
I wrote this app for an installation because I needed to play a 4,800 x 600 Quicktime file across 2 outputs on my graphics card, each feeding 3 triple heads to go into 6 projectors, and I couldn't find a single application that could do it.
Most video applications which can output across multiple video-outs cannot play files larger than the maximum size of a texture (usually 4096 pixels). And even if the movie resolution fits in a texture, they are very slow because they convert each frame to a texture and upload to the graphics card. The only application I found which could play a large file is Quicktime Pro, but that cannot output across multiple video-outs.
MSA QTPlayer is a native Cocoa app which can do this (using QTKit and OSX 10.5) .
This is a demo for a traer like physics library for C++/openFrameworks.
I wrote the lib for a little project with Todd Vanderlin while in Linz, Austria at Ars Electronic 2008 (vimeo.com/1707467). I tried to keep the same API as Traer (so processing code using traer can easily be ported to oF) and it is basically a particle system with springs, attractions, gravity etc (but uses verlet integration instead of RK4).
In this demo I am interacting with the app using the keys:
This is a very early version of a GPU based depth-of-field GLSL shader and sample Processing code. Adjust some parameters and it can also be used to give the scene a nice backlight/glow effect.
I was sitting minding my own business, exploring accumulation buffers in Quartz Composer, when all of a sudden I just zoned out, and next thing I know, I found myself staring at Him on my screen. His Noodly Appendages came down and touched me, and guided my hands, connecting Quartz Composer's very own noodles in His Image.
His Noodly Screen Saver runs on Mac OSX 10.5 (Leopard) and you can download it below.
Seeing as a lot of what I'm doing is based on open-source software and the good intention of others, I think its fair that I release some source code too... So I've tried to clean and comment a bit of the code I used on the psychedelic interactive fluid and particles demo (also used on the Glastonbury 2008 PI Installation.
This is not the full code for the glastonbury app as that is quite complex, multi-threaded and I couldn't release it all anyway. Instead I've simplified it a bit (removed some messy multithreaded stuff and the osc/midi triggering based on camera - you can find quartz composer and processing.org source code for that on this site anyway).
I've always wondered (well at least since Quartz Composer 3.0 was released with Leopard) the performance difference between using the new and much easier to use Math Expression patch, and the old Math patch - and in fact compared to using JavaScript.
So I created the attached test composition and found some surprising results (at least I found them surprising, though in retrospect I can understand why :P).
First of all, all 3 methods are pretty quick, and are unlikely to be a bottleneck. Unless you are using the operations in an Iterator patch with a lot of iterations you won't notice any difference.
The figures below are for 2nd gen 2.33Ghz Macbook Pro:
Quartz Composer is a great piece of software for many things. It has a lot of features which really allow you to create amazing things very quickly. It also has some 'features' which allow you to lose your hair very quickly. One of these 'features' is loading images from within an iterator.
You'd think it was quite straightforward, just send a different string (either generated within the iterator or loaded from XML etc.) to the Image Downloader, but alas QC has other plans. It always loads the same image whatever string you send it!
So I started playing with the House of Cards data in OpenFrameworks, but looks like I'm not gonna have time to finish it for a while. So I thought I'd post a skeleton if anyone else wants to play.
**UPDATE: 20/07/08 **
Just added a Processing source file as well using the BIN data (P5_HoC_bin_v1.zip). Demo video below (all interactions are controlled with the mouse in realtime - pulling/pushing etc.
In case you've been hiding under a rock for the past few days, Radiohead have a new video / concept thing out. To cut a long story short : http://code.google.com/creative/radiohead/.
So I thought i'd hava go as well, but didn't get as far as I'd hoped because the data is stored too randomly for some of the things I wanted to do. So I took it upon myself to add some order to it. My process was:
"Pi" is an interactive audio/visual installation commissioned by Trash City of the Glastonbury Festival to be shown at the festival in June 2008.
Working with arts and technology collective Seeper, our concept was to take a 50ft tent, and convert it into a giant audio/visual instrument - all of the music, audio and visuals inside the tent are generated and controlled purely by the movements of the occupants.
The space was divided into 6 zones. Two of the zones were purely visual, this was the waiting area. Here people could dance, chill, run about and do what they pleased. Two cameras tracked their movement and applied it to the fluid/particles visuals - so people could 'throw' plasma balls at each other, or send colorful waves propagating around the space. The other 4 zones had the same visual interactions, but in addition were also connected to an audio system. Each of these four zones was allocated an instrument type (drums/beats/percussion, pads, bass, strings etc.), and movement within these zones would also trigger notes or beats - depending on precisely where in the zone the movement was triggered. A lot of effort went into designing the sounds and notes triggered to make sure the end result would almost always sound pleasant and not be complete cacophony.
The first psychedelic fluid/particles interaction prototype developed in processing.org:
Camera -> osc/midi interaction tests (developed in Quartz Composer):
The two concepts strung together and written in C++ with openFrameworks:
This is the beginnings of a Processing / Java port of the webcam-to-osc/midi app I originally did in Quartz Composer. The source code for the processing version is below, and you can watch (or download) the Quartz Composer version here).
Its quite early days yet and doesn't have all the features I want (scales, realtime sizing of grid etc.), but I'm posting posting it because:
a.) it does work on a basic level,
b.) It was requested on the processing forums and I thought it might be useful...
It doesn't transmit midi, but does transmit OSC, and I'm using OSCulator to forward the OSC messages to midi. I prefer doing it this way because I can have another computer on wifi receive the OSC messages and map to midi (and send to Logic), keeping the CPU on both machines lighter... (or just keep the oscTargetIP as 127.0.0.1 to send the OSC to the same machine and have everything running on one machine. Flexibility is always sweet).
A test in motion detection in Quartz Composer 3.0.
The music is all generated in real-time by me waving my fingers, hands and arms around (or in fact any motion) in front of a standard web-cam. No post-processing was done on the audio or the video.
The concept is by no means new, but still fun nevertheless - and I'm quite happy with this implementation. I'm using a very simple frame difference technique and generating midi notes based on where-ever there is movement (actually, as QC3 cannot send midi notes I had to send the data as OSC and use OSCulator to forward them as midi).
I was at the Adobe Air Tour 2008 in London today, and while most of it was very interesting, there were moments which were rather dry... so in my boredom I created this little Quartz Composition.
Last fall I was at Flash on the Beach in Brighton, and a guy called Craig Swann was demonstating some amazing things he'd been doing in Flash and Max MSP/Jitter. I remembered one of them today and decided to try and create something similar in Quartz Composer, the results are quite fun.
Basically it captures a very narrow slice of video input (in this case my webcam) every frame and creates a picture out of lots of slices from different times, essentially capturing a segment of time in one picture. The composition here can do it horizontally or vertically. You could try radial and other methods too.
I recently needed to do a little flash app allowing people to draw using the mouse, and then save the data on a server. The most generic and compatible way of doing this I think is converting the shape data to SVG. Below I've listed the code which does this simple conversion. I've stripped a lot of stuff out here to keep this code quite minimal, eventually it would be much better to draw (and save) as curves (instead of straight lines) and do some curve optimization, but that is not within the scope of this post. Also you can add many drawing/painting features to the app like circles, rectangles, text etc.. and just add the corresponding text to the SVG info. Some good SVG documentation can be found at www.w3.org/TR/SVG.
In this previous post I mention creating data-source plugins or processing existing data-sources for VDMX using Quartz Composer. Well the specific example I've given in that post isn't that useful, simply does 1-x^2.
I've just created something which may be a bit more useful, its a springy smoothing patch. So you can attach springlike behaviour to data-sources and modify spring stiffness and damping. Here's the JavaScript:
This is a little test using GLSL in Quartz Composer 3.0, and controlling via VDMX. All happening in realtime and completely audio-reactive with no post production or timeline animations etc. The potential is humongous and very exciting!!
The current latest version of VDMX5 (0.6.2.7) now has the brilliant (undocumented) capability of using Quartz Composer patches as plugins (in addition to clips, effects and text sources).
What you need to do is:
Create a Quartz Composer patch with a published input, and a published output... with JavaScript or Maths nodes inbetween.
Plop your QTZ in your VDMX/plugins folder
Create an instance of your plugin from the Plugin Manager (at the moment you need to restart VDMX for the plugin to appear I think, I'm sure this will be addressed quite soon).
Assign any VDMX data source to the input of your QTZ plugin.
Assign the ouput of your QTZ plugin as a data source to and slider.
et voila! beautiful. I've attached my sample files...
Here is the source code for the previous example of 3D Sprite (billboard) particle system Starry Trails. The source code is by no means generic enough to be considered an engine or library, but is work in progress. I will extend the Node3D, SpringyNode3D classes to use Papervision3D and the Billboards for the rendering, and will definitely carry on working on the particle systems. I've also been converting a lot of noise functions to AS3 and will post them soon... its all getting quite exciting in the flash world! :P
This app is made of quite a few classes so Ill start from the top (application) downwards.
/***********************************************************************
MAIN DOCUMENT CLASS
make sure you have 2 sprites in your library exported for actionscript with linkage identifiers set to RedStar and BlueStar
***********************************************************************/
package {import flash.display.*;
import msa.sprite3d.*;
publicclass StarryMouse3Dapp extends Sprite {publicfunction StarryMouse3Dapp(){
Continuation of the particle system evolved into branch-like structures. Few parameters tweakable in runtime. Click here to view (you will need a java enabled browser to run this applet).
/************************************* CONSTANTS ****************************************/int CLEAR_MODE = 0;
int CLEAR_NONE = CLEAR_MODE++;
int CLEAR_CLEAR = CLEAR_MODE++;
int CLEAR_FADE = CLEAR_MODE++;
//char[][] ClearStates = ["Clear:None", "Clear: Clear", "Clear:Fade"]int BRANCH_MODE = 0;
int BRANCH_NONE = BRANCH_MODE++;
int BRANCH_BRANCH = BRANCH_MODE++;
int BRANCH_DRIP = BRANCH_MODE++;
int BGCOLOR = 255;
int MAX_CIRCLE_SIZE = 15;
/************************************* VARS ****************************************/boolean bMouseMode = false;
float fHeadSpeed = 2;
float fNoiseSpeed = 1;
int iClearMode = CLEAR_CLEAR;
int iBranchMode = BRANCH_BRANCH;
int numBranches;
int numCircles;
BRANCH[] branches;
VECTORFIELD VectorField = new VECTORFIELD(2, 0.5, 1, 1);
First test of the Processing language. Pretty basic particle system. Click here to view (you will need a java enabled browser to run this applet).
The code is quite object oriented so should be pretty straight forward to follow, any questions just ask...
import noc.*;/************************************* VECTORFIELD ****************************************/class VECTORFIELD {privatefloat fNoiseMin, fNoiseMax; // used for scaling values to white and blackprivatefloat fScaleMult, fSpeedMult;
privateint iOctaves;
privatefloat fFallOff;
VECTORFIELD(int to, float tf, float ts1, float ts2){
init( to, tf, ts1, ts2);
}void init(int to, float tf, float ts1, float ts2){float w = 500, h = 500;
iOctaves = to;
fFallOff = tf;