Away3d & the FLARToolkit
3d Flash, Away3d code demos April 26th, 2009Augmented Reality (the practice of superimposing rendered 3d on top of realtime tracked camera footage) has become an interesting presence on the web recently, with the good people at Saqoosha providing the conversion magic necessary for monochrome marker tracking in Flash. The FLARToolkit is derived from the Java based NyARToolkit, which in turn is a conversion of it’s C stablemate ARToolkit, an open source framework coming out of the University of Washington that resolves the output from a webcam into a series of tracked marker coordinates in 3d, based on shape recognition algorithms.
The above demo is an example of the FLARToolkit running with Away3d as it’s renderer. The actual process for integrating the two frameworks is very simple - centering around two classes FLARBaseNode and FLARCamera3D located in the away3d package of the FLARToolkit library. There have been some modifications made here that allow the latest 2.3 Away3d release to function with the FLARToolkit - please use the modded library supplied with the source to successfully compile the demo code, until the official FLARToolkit svn has been updated.
Currently the FLARToolkit can track multiple marker shapes in a single camera output, but in this case it is somewhat limited by the speed at which tracking calculations are made. However, you can still have a lot of fun with it! To use in a non-open source commercial project, special licenses are available to purchase from ARToolworks that grant you permission to use the library free of the more restricting GPL license.
To use the above demo you will need to download and print out the tracking marker. With the ARToolkit it is possible to train an AR app to track any monochromatic shape.
The original ARToolkit has gone through a few new incarnations including the ARToolkitPlus and more recently, Studierstube. The latter allows for many more tracking options (including full color markers), and boasts a vastly improved tracking algorithm that with any luck will find it’s way back to Flash in future AR conversions.

















April 30th, 2009 at 1:10 pm
Can you post the basic source you used to get Away3D running. I downloaded Saqoosha’s full package but it’s a pain to hack through it.
April 30th, 2009 at 5:00 pm
The only source you need for compiling this demo is the latest 2.3 version of Away3d from away3d.com/downloads. The FLARToolkit source is included in the demo source code because of the slight modification present to get it working with the latest Away3d source!
May 2nd, 2009 at 11:46 am
Awesome thanks Rob. Ive been compiling FLAR in PV3D but I find using Collada is a bit more time consuming than straight md2.
May 2nd, 2009 at 12:28 pm
I might be blind but, when I was refering to the source code I meant the actual demo files you mentioned by a Source link. The link leads to:
file://localhost/Users/robbateman/Documents/workspace/AwayFLARDemo/bin-debug/srcview/index.html
Am I missing something? Thanks again.
May 2nd, 2009 at 12:31 pm
http://www.infiniteturtles.co.uk/projects/away3d/demos/FLARDemo/srcview/
Found it. I think your link was wrong.
May 3rd, 2009 at 11:48 am
Hey Rob, Im just waiting to be approved for the Away3D Boards…. im trying to hack your code to run in Flash instead of Flex. Im having success getting no errors and having the cam run. The animation output spits out the events. But when I put the marker up It’s not finding the pattern and showing the model. Im probably doing something horribly wrong. My source is here http://www.andrewkostuik.com/flar_away3d.zip Thanks.
May 4th, 2009 at 7:43 am
@Andrew
apologies - post had an incorrect link for the source. Updated now, thanx for pointing it out!
had a quick look at your source - a couple of things are required:
a) Line 91: set update = true. This is a flag used by flex to stop the view from rendering before stage properties are set (a perennial flex problem)
b) Line 99: Your material is currently being initialised after the model - for the texture to be correctly applied, the material init function needs to come first.
May 4th, 2009 at 10:06 am
@Rob
Thanks a lot for reviewing my source, I guess I completely missed the changing the update to true. And for the materials to come first. After a quick revision I have it running perfectly in Flash IDE.
Thanks again for the help.
May 4th, 2009 at 11:45 pm
Re: “There have been some modifications made here that allow the latest 2.3 Away3d release to function with the FLARToolkit - please use the modded library supplied with the source to successfully compile the demo code, until the official FLARToolkit svn has been updated”
what kind of changes are these? I was able to use FLART with sandy and alternativa without any changes.
May 21st, 2009 at 4:19 am
bump*
What changes u ve done in order to make it work?
May 21st, 2009 at 10:39 am
the changes are in the FLARCamera3D and FLARBaseNode classes and are quite minor. I have submitted them to Saqoosha.net so that they will be integrated into their next code update of the FLARToolkit svn
May 22nd, 2009 at 12:29 pm
maybe a noob question but theres a way to run this using Flash Developer, is made in flex, but we just use open source rigth now, so i was wondering, how to pass it to FD, tx for reading, i was googling it but cant find any decent URL with info.
May 25th, 2009 at 1:53 am
in the current flartoolkit trunk, org.libspark.flartoolkit.away3d.* doesnt even exist, so how can there be any changes in these classes?
May 26th, 2009 at 9:03 am
now it does, but any way
May 26th, 2009 at 12:58 pm
mmh i was runing in my flex and doesnt seems to work files missing… any patch i have to do :D?
May 26th, 2009 at 5:50 pm
@Medasculo Rico Moreno
is there an error to debug with? What files appear to be missing?
June 14th, 2009 at 5:37 am
unable to open ‘C:\Documents and Settings\Administrador\My Documents\Flex Builder 3\AwayFLARDemo\libs’ Location Unknown…
Before u rofl, is my first time working on flex, usually do flash project/adobe flash CS4/ AS3, but not flex :p.
June 14th, 2009 at 5:38 am
btw sry for the double post, and the delay answering, i was traveling in work, so i got to stop investigating away in this month, but i appreciate ur compresion and your atention.
July 4th, 2009 at 8:00 am
@medasculo
you need to actually make a project in flex and copy paste the source to it, that problem is usually when u try to import directly the project from ur rar, and the flex cant find the path where u have it.
hope this helps cheers
July 18th, 2009 at 6:25 pm
[...] along with the existing support for Papervision3D and Flash Player 10 3D. Thanks to makc and rob bateman for their assistance with matrix and camera [...]
July 21st, 2009 at 11:45 am
I’m trying to make my first demo with FLARToolkit and Away3d on the FlashIDE.
It seems that the “Embed” of the files doesn’t work… and I supose it’s only for Flex… how can I do that?
I tried to open Andrew’s fla but I can’t. I supoe he’s got CS4, and I only have CS3….
Can someone help me?
thanks!
September 13th, 2009 at 3:57 am
I have a problem. Can I add child to fBaseNode as Object3dloader like 3ds loader?? Can someone help me.
October 7th, 2009 at 4:07 am
I tried to port the two “org.libspark.flartoolkit.away3d” FLARBaseNode and FLARCamera3D to the new away3d lite. But i failed. Have you made a useable Version already?
October 7th, 2009 at 7:00 am
Away3D Lite has yet to have a plugin submitted to the libspark project for inclusion in the FLAR Toolkit, but it is certainly on our todo list. Thanx for showing an interest, we will try and get an update released soon!
October 8th, 2009 at 7:16 am
hi rob,
ok, it’s running
link to the forumpost:
http://groups.google.com/group/away3d-dev/browse_thread/thread/cab67e7cf56da68a/ece658a5eacfaf02#ece658a5eacfaf02
December 8th, 2009 at 12:04 am
Hey rob,
Cool demo, thanks for the source it really helped me jump start my project.
http://www.daevision.com
It’s a tool that lets anyone use augmented reality and it also generates unique embed codes that allow you to see your own 3D models or 2D images on your site in augmented reality. Check it out!!
January 12th, 2010 at 2:31 pm
Parceros, está del pts. ¡Gracias!
Luego de unas modificaciones simplemente “it works”, lo trabajé con:
+ Flash Builder 4 Premium Beta
+ Away3D_3.3.4.swc
att: jacanon7@gmail.com