Introduction to Augmented Reality
Here are links for everything we (me & Itai Asseo, also of Digitas) presented last night for flashcodersny, in the glamorous downstairs basement of Think Coffee.
Big thanks to Itai for co-presenting, to Lisa Larson-Kelley for setting everything up, my lovely wife Fanny for joining us, and for all who endured the stuffy heat of the basement last night.
Theory
A big AR Conference, in Orlando of course
Historical Examples
From that movie, what’s it called again?
How Ubiquitous is AR?
Gratuitous Celebrity Politicians Demoing AR (seemingly unaware that they are doing so)
NYTimes article from 03/09 on Topps baseball cards
Another video of the Topps baseball cards
The Underlying Technology
Many ports of AR ToolKit to other languages
FLARToolKit, the Flash port of AR ToolKit. Almost Everything you see on the web uses this!
A very good diagram of the AR rendering process that I forgot to show last night.
Interactive Demos, you need a webcam and a printer for these
The Katamari Damacy themed 09 NY demo that got everyone excited
Who wants to hold the baby? (fun Boffswana animated critter)
Toyota iqReality Car Demos (downloadable demo)
FLAR Drums (from the prolific folks at squidder.com)
A Funky Brazilian Santa, really.
German Cabriolet demo that doesn’t seem to work, but show nice usage/execution in the video.
Videos
Fiducial markers on T-shirts, squidder again
Little driving car demo, uses marker in interesting manner, squidder again!
AR Tutorials Galore, most modern first
squidder.com: A bunch of great stuff! These guys seem to be posting stuff every day, keep an eye on them!
Great getting started series of tutorials, from Mikko Haapoja
The original tutorial set, haven’t tried it yet, saqoosha.net
Making Custom Fiducial Markers
saqoosha.net again: The AIR app for generating markers (this worked well for us)
Source Code Samples You Can Download and Play With!
Source for the amazing 09 New Year’s demo, good luck getting it to compile!
Boffswana animated critter demo code (this is what we started with)
Squidder.com’s demo of using multiple markers (very easy to compile and set up)
Eric Socolofsky’s very new FLARManager. This sounds awesome, but requires either CS4 or Flex Builder set up to target FP10, so have not been able to play with it yet. (Here are 2 links for how to set up FB3 to target FP10, here and here)
Wait, update: Eric has released a new version of his FLARManager for FP9! See his comment below of follow the link for more info. Thanks, Eric!
Just in right now! Itai sent this to me and it looks very promising, another AR demo with sourcecode.
Augmented Reality Blogs Worth Following
The original and very worthy Augmented Reality Blog
Squidder.com, putting out awesome AR demos apparently every 30 minutes.
Where it all began, saqoosha.net
Special Bonus Links, Check Out the Amazing Libspark library!
Lots of great stuff here, including the Marilena Object Recognition AS3 library that people are using for Flash face recognition.
I’m adding stuff to my delicious links all the time as they come in. You can see my up to date AR links at: http://delicious.com/shinyamos/ar
Using ANT in your Flash Development Part 2: Basic ANT Concepts
This is the beginning of the “HOW” part, if you want the “WHY”, see my previous post in this series here.
You must define your ANT tasks in an xml file. Typically, this file is called “build.xml” and I like to put it in the root of my projects. Here’s the most basic example of such a file:
<project name=”Basic ANT”>
<target name=”Hello World”>
<echo>Well, hello world!</echo>
</target>
</project>
Running ANT in Eclipse
- Go ahead and create a build.xml file in your Eclipse project now. Paste the code above into the file and save.
- Go to the to menu and select Window->Show View->ANT (if you don’t already have the ANT window opened in your workspace)
- Drag the build.xml file from the Explorer Window to the ANT window.
- You will see the ANT task appear with the title defined in “project name” above, in this case “Basic ANT”. If you open it up, you will see a list of the targets defined in the ANT project.
- Double click on the Hellow World target (aka task).
- You will see something like this:

Hello World Output
The project (name, attributes) is defined in the <project name> node. You must define the name, and optionally the default target and the basedir (base directory) property. Here is a typical project node definition:
<project name=”FCNY USEFUL ANT Tasks” default=”CompileMain” basedir=”.”>
The targets are the actual tasks that get executed. Each target has a name and one or more task definitions.
A task is the bit of code that actually gets executed. There are a huge number of basic built-in tasks in the core library that include things like: basic file operations, echo, building filesets, etc. The tasks we’re interested in most are the Flex ANT tasks. These are what will allow us to compile Flash applications without using the IDE and to generate all manner of workflow tricks.
There is a huge library of optional tasks that are easy to add to do pretty much anything that can be done from the command line: ftp files to a server, perform version control operations, run unit tests, etc.
A property is the equivalent of a variable in ANT projects. The following line defines a property and uses the ${propname} syntax to reference the value of the “basedir” property defined in the property definition above:
<property name=”mainFLA” value=”${basedir}/MainAssets.fla”/>
It is good practice to use property definition files to define and group your properties. In my real world example, I have 2 property files: “default.properties” and “local.properties”. The first defines properties that are global to the project and will not change, such as default project structure settings. The latter defines properties that need to be edited for each users computer, such as the paths to their favorite web browser, the location of their Flex SDK, etc.
Task Dependencies
You can use dependencies to chain tasks together, so that they run in sequence. The concept of dependencies in ANT can be a little confusing. If you define a task “D”:
<target name="D" depends="C,B,A"/>
The target D tasks will be executed after C, B and A are executed, in the order specified. What can be odd is a situation like this:
<target name="C" depends="A, B"/> <target name="D" depends="A, B"/> <target name="F" depends="C, D"/>
If you were to run task F, you may expect to see tasks executed in this order: A, B, C, A, B, D.
But you’d be wrong! What you’d actually see is: A, B, C, D. When D is executed, it sees that the A and B tasks have already been executed, so it won’t run them again.
To use a target multiple times in a single invocation, you need to use antcall. This will allow you to treat targets more as subroutines.
The next blog will explain how the sample project is set up and begin detailing the many example tasks in the project.
The iPhone Really is Magic! 1 Week on a Single Charge!
This is off topic for me, but I think it’s worh a minor blog entry: to my surprise, the iPhone really is pretty damn good.
Now, I am not an early adopter by any means. After my antique cell phone finally fell apart, I broke down and got myself an iPhone like all the other kids already have.
I’d heard a lot about how crappy the phones were in terms of battery life, but was mightily impressed: I got my phone last Thursday, charged it up, and it still had a bit of charge left a full week later! Really though, I’m not a typical user; the first thing I did when I powered it on was to turn off 3G, WiFi and Location Services. I turned it off at night, and during subway trips, but otherwise used it normally (as a phone). Plus did a bit of web browsing and checking out the App Store, turning on WiFi when I needed to use it.
But, it’s a great basic phone (with lots of optional dazzling features that you are free to ignore). The call quality is much better than my previous (admittedly crap) phones, as is reception. Plus the interface does justify the hype. And excellent battery life if you mainly use it as a phone, who knew?
These Apple folks might be on to something…
Using ANT in your Flash Development and Be a Better Person! Part 1
OK, long time coming, but here we go. There’s too much material for one blog post, so I’m going to break it down over a few blog entries. This series is based on a talk that I gave to the fabulous flashcodersny group, on Aug 13 2008.
ANT is a fantastic tool for automating your Flash development workflow. ANT allows you to write powerful tasks to do just about anything you could desire: compiling Flash (AS2 or AS3), file system operations, ftp’ing files, setting version numbers, generate code documentation, play annoying sounds, etc.
I’ve been hearing about ANT for a while, but only came to adopting it after some frustration with the Flex Builder workflow. At my shop, we have Flash developers who use FDT and, more recently, Flex Builder. We like to check the final SWF into SVN when we have a release build. This allows us to just export a copy of our build files and push them to the server when we want to deploy. Works well enough, and it means that I don’t have to be present for weekend pushes!
I’ve heard compelling arguments about why putting SWFs into version control is a bad idea, but it’s really very convenient, and you don’t need a developer with the fully configured environment for deployments. Anybody who knows how to use the version control system can perform a deploy.
But, Flex Builder will not let you work this way! The default workflow creates a bin-debug folder where your compiled SWFs end up. You cannot check this directory into SVN. I understand their rationale for this, but it’s annoying, and has tripped up a lot of developers. And you can’t customize the workflow too much with Flex Builder, you have to do it their way. Also, the default version that Flex Builder compiles is a debug version, not a release version, so you would not want to check it in anyway. Also, I wanted our developers to be able to use FDT, Flash, or Flex Builder as they wished, on the same project, and the Flex Builder workflow made this difficult.
So, I turned to ANT to get around these issues, which I was able to work out. But, then I realized how much more I could get from ANT, and I find I’m using it more and more with every project, and it’s especially made my life much easier with complicated deployments (4 different server environments requiring different configurations). I’m using ANT on every project now and it’s become widely adopted in my department.
The solution to a unified workflow was to adopt ANT tasks for all Flash compilation. We compile projects the same way whether we’re using FDT, Flex Builder, or Flash. You can execute all of these tasks from within Eclipse, or from the command line if that’s how you roll. The entry on compiling Flash (AS2 or AS3) is part 4 of this series.
Part 2 will introduce basic ANT functionality and the files for my sample project.
Useful Links
You can get the full story on ANT here.
I found these 2 posts very useful for getting set up with ANT in Eclipse/Flex Builder:
Jody Brewster’s Installing Ant in Flex Builder 3
Ryan Taylor’s article on using ANT with FDT3