Categories
General

FlarToolkit made easy : SimplAR

As cool as bell-bottom pants according to Keith Peters! Which is pretty damn cool. And it can be really fiddly setting up the FLARToolkit, so I’ve finally released some of my AR code. Just in time for it to go out of fashion. 🙂

It uses the Alchemy branch of the FLARToolkit and includes everything you need to get up and running. It also has a very optimised automatic threshold adjustment system that takes virtually no extra processor time.

Here’s a quick intro :

It’s easy to use, there’s just one class. And I’ve also included swc files for the FLARToolkit Alchemy branch and the latest revision of Papervision2.1. You just need to extend the class and override the add3DObjects function.

package ly.seb.simplarexamples
{
	import ly.seb.simplar.SimplarBase;
	import org.papervision3d.objects.primitives.Sphere;
	
	[SWF (width="640", height="480", backgroundColor="0x000000",frameRate="30")]	

	public class AR_Sphere extends SimplarBase
	{
		
		override public function initialise() : void
		{
		
			var sphere : Sphere = new Sphere(null, 40); 
			sphere.rotationX =  90; 
			sphere.z = -50; 
			
			//add it into the container that is updated 
			//relative to the pattern marker
			container.addChild(sphere); 
			
		}
		
	}
}

Check out the screencast below to see how to use a custom marker, handle when the pattern is lost and found, and load a 3D model in.

You can check out the project from my googlecode repository at : //code.google.com/p/sebleedelisle/

There area couple of extra things I’d like to add to the code, at the moment the size is fixed at 640×480 and the image is not mirrored; both things I would like to fix in the future.

I’d like to thank thesven.com for his FLARToolkit Alchemy code that saved me masses of time! Thanks also to Jesse Freeman and Kyle Kellogg for helping me test this.

38 replies on “FlarToolkit made easy : SimplAR”

[…] FlarToolkit made easy : SimplAR | Seb Lee-Delisle […]

Hi Andreas,

that’s currently a limitation with the Alchemy branch of the FLARToolkit – you can only work with one marker at a time (at least it was last time I checked!). If you need multiple markers you’ll need to set up the “normal” FLARToolkit code base.

cheers!

Seb

Hi,

First of all a lot of thaks for the lynda.com training videos, I am the premier member of lynda.com. I working on AR project I need to create application with FLARtoolkit. In application I have to create some kind of interactivity with the 3D object and also need to create a menu with active buttons. When click on the button object will do some thing. I am really confused about how can I achieve this. Please give me some advice to get my project done. I will be really thankful to you.

Usman

Hi Usman, can you pass all technical requests regarding the Lynda.com training through the Lynda site, please? Use the Support>contact us>Technical Support(Content) link. Cheers!

Thanx for ur reply, I am not asking anything regarding lynda.com I just want you to give me some direction to start and finish my project. I know it is not appropriate but if you can then I will be thankful to u.

Usman

Hi Seb – I’ve been able to run your source in FB4, but I’m having difficulty importing a custom .dae file… I’ve tried exporting in Maya, Modo, and Blender (both DAE 1.4 and 1.3.1), but I ended up getting just the default box.

Also tried importing your torusknot to those programs and re-exporting… Resultant = still default box o.O …

Are there specific conditions needed for the dae file?

Which program did you use to create the torusknot?

Hi Yos, Sounds like your project isn’t set up properly. There are full instructions on the second video above, and the examples provided show you exactly how to load models.

cheers

Seb

Hi Seb, I did actually go through the examples in the second video before posting – I was able to run all of your examples in Flash Builder 4, but I just couldn’t load in a custom dae (this was simply putting in the dae in the bin-debug/asset folder and changing the filename of the .dae file mentioned in the dae example). I think it might be due to collada export version – but there seems a dearth of documentation on importing collada files to papervision. Anyhow – which program did you use to model your torus?

Hi Seb! Got the custom model to import (apparently it was too small – blew it up about 1000x and now it’s visible) … next step would be figuring out how to include the same model with fancy materials (looks like only diffuse is showing – what about specular, etc) – any advice?

How do you deploy the SimplAR Flash Builder project to .swf on a web server? (bin-release .swf’s don’t seem to work outside of bin-debug)

The Lynda course is beyond my budget for this weekend project, but I’m wondering if what I’m trying to do is beyond what’s possible in Papervision3D/Flash 3D.

Since image data is fed in from the webcam, is it possible for the virtual object to be semi-transparent? All the examples I’ve seen so far involve opague- objects.

So, the object I’m trying to import is a glass jar of water. Rather than just baking down textures, I’d like to make it look realistic, with semitransparency and all – just like a glass jar of stuff ought to look.

Here’s a render //posterous.com/getfile/files.posterous.com/ina-zntvj/8jDvFxEtEMvu80vrrgiarCpMoF4Ltjgj8ChE76IrNjakc3eGKCjqYmxebct3/testbottle2.png

Also, in other news, on setting the “generate html wrappers” checkbox in “actionscript compiler”, the .swf loaded in the browser shows up as a black screen, still! I get the prompt for webcam box on both, but I’m only able to get image from the webcam when I double click the .swf to run it by itself [not in the browser]

HI,

for my company I’m evaluating FLARToolkit and FLARManager for making presentations for our costumers.

I have already imported a .dae file into my project.
My questions are:
– how I put 3 different .dae files (one on enter, one looping, one on exit)?
– how I make the 2nd .dae finish looping and the 3rd run after the marker is out of screen?

Have you got a simple sample to help me?

Thank you very much.

Stefano Demattè

Hi Seb,
First I should say that I am “new” to this whole world of this programing.
I recently stumbled on your video’s on setting up the Artoolkit on youtube. As I recently download the kit onto my mac and have no clue how to run this program. But, it seems that your “SimplAR” file helps run this Artoolkit. I looked for this file on your blog and I can’t seem to find it. Could you email me a link to this “SimplAR” file to down load it.
Thanks I’m looking forward to your reply.

Hi Seb…

Got the source.. Thank you for your work on this..

Any idea how to capture a bitmap image of the webcam including the AR object?

is this a Papervision function… or would I need to combine 2 separate images?

[…] Papervision pioneer Seb Lee-Delisle’s work with FlarTOOLKIT Alchemy. His very excellent SimpleAR work is great and I highly recommend checking out his stuff. Only draw back is that the Alchemy […]

First of all.. Thank you very much for the effort!! Keep up the great work.

I have a question/problem regarding the use of collada models. It seems like they are rotated/angled automatically towards the camera when the marker gets angled in front of the webcam.
Is this a ‘setting’ within the collada file, or how can I resolve this within the actionscript file(s)?

Thank you!
Robert

Hi,
gr8 video you have there. The code you show in the video seem to be different from the code in SVN. There seem to jus the RacingCar code in the SVN. Any place i can get the other codes?

Thank you very much, your tutorials are Awesome !!

However, i would like to know how can I use multiple markers with Alchemy.

Thanks for your Time.

24emal

Hi Seb, I’m just starting to work with AR and found your tutorial to be the most comprehensive tool to start working, however I’m not able to check it out from the code repository.

Is it still up, or do I need a special permission to download it?

Thanks for your time!

Hi Seb,

i also start workin with AR and thank you for sharing that great project!

I’ve never used the code.google site and i’m trying to get that project downloaded – but it’s not that asy to me 🙁 most of the files i can click on and show as plain-text files in my browser and copy & paste it. But how do i get the swc, swf, jpg etc. ?

Or is it possible to download the project as a zip file ? Would be great 🙂

P.S.

Got that SVN Thing handled, thank you so much for that awesome project! A last question: I don’t have Flash Builder but Flash 5 Pro ( within CS Design 5 ), is it possible to make a flash project out of it? Which will be the document class ?

Hi,
I would love to take a look at your project since I was not able to get the “standard” FlarToolKit to work.
But I can’t find your project on your google code site.
Where can I download this project?
Cheers,
Juri

Comments are closed.