Pretty Extreme over Manhattan


That’s the view of Manhattan from the top of P.S.1., circa 2002. Usually, the words aren’t floating around the balcony like this, but when you ask thesaurus.com for words that mean “EXTREEEEME,” these are what you get.

This is a test I produced to demonstrate the use of NVidia’s PhysX physics modeling libraries with the openFrameworks graphics libraries. I’ve built the real time system to react to midi, OSC, raw UDP or (and) an audio input. Of course, for this demo, I had to hard-code hit triggers on particular frames, render to a jpeg frame sequence, whip up a quick project in Ableton Live and encode it from there.

Come see an extrapolation of this real time system live in action at OBJECTify on 5/10/09 objectifynyc.com

Some technical notes:

Characters here are modeled as simple “capsule” shapes, sized to fit the characters appropriately. I don’t believe the modeling of these shapes takes proper advantage of NVidia PhysX hardware acceleration, but it’s still plenty fast with only 300 objects, as seen here. I did try to use the PhysX fluid modeling libraries, which are hardware accelerated, and would allow a far greater number of particles, if desired. However, with the fluid, I was unable to simulate the proper reaction between particles that you see above. It seems that in 2D, multiple fluid particles have a tendency to occupy the same space, which screws up the effect.

The point of this exercise, really, was to develop a system for dynamically placing these characters in different positions on the screen. Each character is bound to a capsule shape, (Mobile,) a dummy shape, (Target,) and a spring. The character is drawn on the Mobile shape, which is sized to match the character. When the character/Mobile Shape is allowed to fall and interact with the others, the spring is disabled, and the character falls onto the heap. When the character is set to move into position, the Target shape is moved to the intended position, and the spring is enabled. The character is pulled toward the Target shape, and it moves into its precise place in the text string. When this occurs, I leave the collision interaction on the Mobile shape active for a few frames, so that other characters might initially be dragged along with it. After 3 or 4 frames, I disable the collision interactions on the Mobile shape so that it can rest comfortably in its intended position without being jostled by other characters, or preventing the falling of other characters.

The colors were inspired by the “Celtic” palette I found on Kuler, although Quicktime does something funny to the colorspace when I open a jpeg sequence, so the colors aren’t quite right in this rendering. Picking colors with Kuler is much better than my old system, in which I’d pick a triplet of byte values that felt good and randomize the RGB color values within a certain range of those byte values. Not a recipe for attractive visuals, though I still like the idea of slightly randomizing all of the colors just a little.

The music is something I whipped up in 10 minutes with Ableton Live, which I had to re-install on the laptop in question. Somehow, all of the synth presets were missing, but I really wanted to get this demo up quickly. This is what 3 minutes of Operator programming will get you.

May 1st, 2009 | art

2 comments

I didn’t really integrate physx into the OF framework. I’m working in MSVS, so I just started by grabbing all of the necessary libraries from a physx sample project, integrating them into my test OF project, and getting it to build. After that, my application talks to physx for the simulation, then uses OF to render the graphics. The two aren’t really intertwined any more than that. I haven’t built the physx references into an OF addon because (1) I don’t know anything about compiling the stuff on a Mac, and (2) physx is so big that it seemed futile to try to encapsulate a subset of functionality in an addon.

I created this project over a year ago, and don’t recall if I ran into any particular trouble building the project with physx and OF together. If you have problems, let me know.

Comment by Josh — April 21, 2010 @ 10:09 am

Hi, its really nice…i would like to know how you have have binded OF with physx. thank you.

Comment by yafes — April 20, 2010 @ 8:28 pm