i’ve been getting my hands into fiducial tracking at work over the last few months, and successfully implemented reacTIVision for an exhibit. amazing software, easy to use right out of the box, and very fast and accurate. (thanks martin & co!)
when i came across the GE augmented reality thingy, i realized that that kind of experience can finally happen online. i took a look at FLARToolkit, and was simultaneously excited and stymied — so much potential, but tricky to use and understand.
i came across Mikko Haapoja’s excellent starter tutorial and got a much better understanding of the system. after a bit more digging, i decided to try to make FLARToolkit as accessible as reacTIVision.
a couple weeks later, i finally have a small framework put together that makes steps in this direction. behold, FLARManager v0.1.
i had a list of goals with this, including, but not limited to:
ease of use: FLARToolkit is not the simplest thing to get up and running. FLARManager makes it easier, by encapsulating some of the hard bits, and providing plenty defaults for quicker setup. it also uses composition as much as possible, instead of inheritance, for maximum flexibility.
decoupling FLARToolkit from Papervision3D: i can think of lots of uses for marker tracking that don’t require Papervision3D, or even 3D for that matter. for example, how cool would it be to do this in an online app? also, Flash Player 10 offers 3D capabilities natively, and it would be nice to be able to take advantage of those as well.
marker management: similar to reacTIVision, FLARManager maintains a list of active markers, and dispatches events when a marker is added, updated, or removed. multiple marker patterns can easily be used, and multiple instances of each pattern are also no problem.
i managed to hit all those goals, and learned a lot about the FLARToolkit engine along the way. i also figured out how to get FLARToolkit running at a good speed (on my last-generation MacBook, i consistently hit 20-25fps, even with multiple markers on-screen). i even got to get my hands dirty with some of the new features of Flash Player 10, like the Vector class, and some basics on drawing in 3D in FP10.
ok, enough. again, link to the source:
FLARManager by Eric Socolofsky is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
i’ll leave formal documentation for another post; i took great pains to comment the hell out of the code, and if you want you can even make ASDocs out of them. suffice it to say you should be good to go if you just download the source.
oh, one more thing: there are four examples included in the zip, along with a Flex Builder project. the examples are all set up to be run as FB Applications. they are:
FLARManagerTest_2D.as: simple example that draws outlines around detected markers.
FLARManagerTest_2D_NoVideo.as: runs marker detection on a source loaded from a file (e.g. .swf / .jpg) instead of a camera. good for testing when it’s dark out, or when you’re cameraless.
FLARManagerTest_PV3D.as: the standard FLARToolkit + Papervision3D example, with lil’ cubes strewn around my kitchen table.
FLARManagerTest_Flash3D.as: a first stab at getting FLARToolkit to work with 3D in Flash Player 10. it’s not working yet, because i’m having trouble figuring out how to translate FLARToolkit’s FLARDoubleMatrix34 into Flash’s Matrix3D. any help here would be much appreciated!
look forward to seeing what you all do with this!