Behind the Tangible scenes


[ T ]




Most recent update (everything’s coming along).




And, how. Ordered selection included.

[ T ]




And, how. 30 vids.

[ T ]




Objects (polygons) changing size, reacting to physics and colliding with a bunch of other rigid objects.



Box2D objects resizing and reacting to world physics (only polygons at this point).


Core Animation (Troubles?) -> Box2D (Solution!)

So, we thought that using the CoreAnimation framework (CABasicAnimation functionality) would make it easy to change the sizes of destination rectangles for video playback. But, after trying to access the dimensions of animating objects we realized that you can’t actually access an object’s data in mid-animation. Without looking into it in tons of detail, we figure that CA sets up a thread that handles the animation allowing access only to the final state of the object (i.e. what it’s supposed to look like at the end of the animation). So… This isn’t good…

In order, then, to have access to the resizing of objects we looked into Box2D and found that you cannot change the size of an body once it’s been created.

What you can do, however, is update and delete the shapes inside a given body. If you do this quick enough, the object acts as if it’s changing size while maintaining its mass, acceleration, etc. properties. We found some nice code examples provided by Emanuele Feronato that describe how to scale objects in Box2D. She works mainly in Flash, but the concepts are easily integrated using the appropriate accessors in Cocoa.


Box2D Cocoa

So, Box2D is a great physics engine (there’s quite a lot of people who think so), and the examples they provide are great. Even though they offer an xcode project that will run their helloworld and testbed applications, they don’t actually offer a suite of wrappers that connect the Box2D and Cocoa APIs.

Digging around a bit, I found a very nice project example written for the iPhone and provided with an explanation via Zinc Roe Design. In particular, there is a nice explanation for adding Box2D to an iPhone XCode project, which is easily ported to a normal XCode project. As well they have posted a really nice, clean, iphone project that has a couple of classes which act as mediators between Box2D and Cocoa. With a bit of tweaking I was able to clean it up (i.e. removing iPhone SDK references) and use it in our own project.

[ T ]


AppDelegate * DisplayLink Issues

Last week I focused on reworking a video matrix viewer from an old project structure (adopted from Apple’s LiveVideoMixer example), into a Cocoa Application (i.e. using an ApplicationDelegate). And, after quite a lot of cleaning up code, removing odd bits and digging into forums looking for tips on how to switch over (of which there are few)… I wasn’t able to get past this:

CVDisplayLinkStart(displayLink) == kCVReturnSuccess

Despite knowing that the displayLink object is not NULL… I simply couldn’t figure out what the problem was. So, I went back to the original structure and will rebuild the project in a different way from that foundation.

I learned along the way that linking objects using…

(id) anObject;

…allows you to connect outlets in Interface Builder without having to import the classes for the objects you wish to use.

We ran into this issue when using the Core Video framework and trying to import Box2D headers. There’s a clash that we couldn’t resolve. So, instead we can setup an independent object with a b2AABB world which will run the physics engine, and we can access it via a referenced outlet in the main video matrix view.

[ T ]



New video of the light stick now with the final size, 6 feet frosted tube.



12
To Tumblr, Love PixelUnion