Start-up guide for FLARToolkit
Required
- Adobe Flash CS3 or later
- FLARToolKit
- Papervision3D (rev. 817 or later)
- Webcam
- Printed marker & marker data
Download - source of FLARToolKit
http://saqoosha.net/lab/FLARToolKit/FLARToolKit-starter-kit.zip
Let's get started!
If you are familiar using Papervision3D, this FLARToolKit will be easy to control. You can do whatever you want as if you control Papervision 3D.
If you are non-Papervision3D user, don't be afraid! It is much fun and easy to control.
One thing you should take care of is that a coordinate system is different from Papervision3D's.
The global coordinate system of Papervision3D is left-handed, but the object on the marker of FLARToolKit will become following image.

Sample source code
You ONLY need to understand how SimpleCube.as works. Other sources are ....well, you can forget about them.
line 24:
init('Data/camera_para.dat', 'Data/flarlogo.pat');
Initialize FLARToolKit.
The 1st argument is a path for camera corrective file. You can leave it as default.
The 2nd argument is a definition file of marker pattern. You need to define the pattern for the marker. e.g. flarlogo.pat is for flarlogo-marker.pdf.
line 27:
private function _onInit(e:Event):void {
Once init call is successfully over, this function is called. You can adjust 3D object here.
If you can not call this function and error message comes out, you should check the availability of pattern-file OR condition of Webcam.
line 30, 31:
var wmat:WireframeMaterial = new WireframeMaterial(0xff0000, 1, 2); _plane = new Plane(wmat, 80, 80);
These codes discriminate how the marker works fine or not.
They publish the Plane as a dummy, as same size of as marker(color Red, 2px line, 80mm)
line 32:
_plane.rotationX = 180;As I discribed above, Papervision3D and FLARToolKit have an opposite coordinate system.
This code adjust the coordinate system.
line 33:
_markerNode.addChild(_plane);
Papervision3D normally "addChild" Scene3D, FLARToolKit needs to "addChild" a special node as it controls 3D object following the marker.
The special node is _markerNode.
Once you "addChild" _markerNode, the object follows the marker automatically.
line 44, 45:
var fmat:FlatShadeMaterial = new FlatShadeMaterial(light, 0xff22aa, 0x75104e); _cube = new Cube(new MaterialsList({all: fmat}), 40, 40, 40);
Now let's play with "Pink Cube" on the marker.
Size: 40mm*40mm*40mm. The half size of the marker.
line 46:
_cube.z = 20;The Cube is based on the center/core(=zero point).
Here is the tips: Transforming +20 , Z makes the object is right on the top of marker.
Now the time to play FLARToolKit!
Here we go! Let's follow the steps.
1. Open SimpleCube.fla with Flash Authoring
2. Publish it! then you can see the contents with Webcam
Note: If you are not connect with Webcam, you will see the error messages.
If you can not see the contents although you connect with Webcam, you need to set-up Webcam.
[right-click => setting => Camera. you should choose "USB Video Class Video" on Mac OS]
3. Capture the marker, then you will see the object.
see? it is easy!
Thank you for reading this description :)
See, this is easy!! If you can control Papervision3D, why don't you control FLARToolKit too?! Let's have fun, let's move virtual kids!






Feb 2nd, 2009 at 05:58 PM
tks.that so cool.
Feb 3rd, 2009 at 12:02 AM
Thanks for giving us a whole new wonderful world!
Feb 3rd, 2009 at 01:38 AM
Thx. Very Cool…though I am having issues detecting the pattern. Is there anything specific I need to do in order to detect the printed marker? The capture is working so I can see the video, however, none of the PV3D objects are showing and it appears that pattern is not being detected. ( Latest Version of PV3D is installed ). Thanks in advance!
Feb 3rd, 2009 at 02:03 AM
Steve,
Is the room dark?
It’s very important to adjust the light. illumination.
Adjust the light to get better contrast for the marker.
Feb 3rd, 2009 at 02:34 PM
tks
Feb 5th, 2009 at 12:45 AM
Thank you so much for your work and your sources man !
Keep the good work !
Feb 5th, 2009 at 03:12 AM
Simply Amazing, good job.
Feb 5th, 2009 at 06:11 AM
This is really great. What did you use to create the .PAT file? I can’t fine a utility to do it, and if I want to create different ones, I am not sure what process to go through. Thanks for your hard work!
Feb 5th, 2009 at 10:41 AM
To create original .pat file, use this site.
http://flash.tarotaro.org/blog/2008/12/14/artoolkit-marker-generator-online-released/
He improved my marker generator AIR application.
http://saqoosha.net/en/2008/06/05/676/
Feb 5th, 2009 at 05:10 PM
flarlogo-marker
Feb 6th, 2009 at 05:05 AM
Downloaded latest svn version and it does not compile, there are typos in FLARVersion.as (displaced stuff) which is easy to fix
Feb 6th, 2009 at 06:00 AM
Just cant make it work : ( Do you make your pattern and then write over the flarlogo.pat with it?????
Feb 9th, 2009 at 01:15 PM
Really impressive! As of now, is it possible for different markers to represent different infomation?
Feb 9th, 2009 at 07:20 PM
Hi,
what about away3D version of flartoolKit ?
Feb 11th, 2009 at 03:13 AM
[...] 이것으로 3차원 공간의 카메라 위치를 계산하도록 한다. 소스코드와 사용법(Papervision 3D 예)이 공개되어 있다. 아래와 같이 만들어진 판을 들고 [...]
Feb 11th, 2009 at 11:55 PM
it’s so cool!!
Feb 17th, 2009 at 04:50 PM
Thanx man,
、最終的にポートをありがとうフラッシュ
(sorry for my(google’s translate service) bad japanese)
Feb 18th, 2009 at 07:56 AM
thank you
It’s so great!!
I’ve changed the marker and it works.
But I don’t find how to change the 3d Object.
Feb 20th, 2009 at 01:20 AM
Funtastic :)
Feb 21st, 2009 at 07:27 PM
hi, thank you for this good stuff.
I have a quick question is that I want to change the cube’s height w/ a random number in a enterframe function but seems that cube only apply the large number and won’t transform to small again.
Thanks for ur help.
Feb 22nd, 2009 at 12:48 AM
thank you saqoosha for this cool kit.
Is it possible to use two different markers with two different 3d animations at same time?
Feb 22nd, 2009 at 04:24 AM
Thank you this is really great, I wanted to know if anyones knows how to create that hole animation on with the stating up guide.
email me at almog@almogdesign.net
Feb 24th, 2009 at 10:50 PM
Hi, cannot download the starter kit, download keeps breaking off… can you please upload this starter kit to to mediafire or rapidshare? Thanks for the cool work, really looking forward to to using FLART :)
Mar 3rd, 2009 at 02:49 AM
inspiring..!!! thanks!
Mar 5th, 2009 at 07:12 PM
I replaced the Flarlogo.pat with some other logo with same name.Its not working,should it work with any other pat file with different content but same name as in path?
Mar 6th, 2009 at 01:33 AM
Could you explain how to display a different 3D object besides the primitive cube? I have looked through some of your other projects source code and you use a lot of .dae models but your .as files are not as simple as the ones in this start-up guide. Thanks.
Mar 6th, 2009 at 02:23 PM
maybe someone can help me. i’ve got this all set up and compiling fine, and i can run other flartoolkit demos online just fine. when i build the demo, though, the marker just never seems to be detected. i just don’t see any change, except that memory goes up whenever there is ANY marker on the screen ( i guess system detecting a black square and trying to read it?) any thoughts? thanks so much.
drMikey
Mar 8th, 2009 at 01:09 AM
Hi
this all looks realy great but im new here and want to ask if there is an complete howto for noobs like me?
would be realy nice because i realy want to learn something about this
Mar 8th, 2009 at 01:46 PM
Hello! Nice tutorial !!
How i apply the ’smooth’ propertie to a bitmap texture ? give a code line of this please ?
thanks a lot!!
Mar 9th, 2009 at 09:20 PM
非常感谢!希望能越做越好
Mar 10th, 2009 at 01:48 AM
hey saqoosha!
first off — FLARToolkit is GREAT. so nice to have computer vision available in the browser!
i just finished up a small framework called FLARManager that makes using FLARToolkit simpler. you can find it here:
http://words.transmote.com/?p=10
it decouples FLARToolkit from Papervision3D, so you can use FLARToolkit for things totally non-pv3d related (though you can still use it with pv3d!); it can track multiple instances of multiple patterns; and a bunch of other good stuff.
please check it out!
Mar 10th, 2009 at 08:07 AM
This is super cool if I can get it to work. Can you do a quick starting video? It would be very useful for people who likes to watch rather than read.
Mar 11th, 2009 at 12:46 AM
Hi!!! very nice work!!!!! its amazing! I’m trying to play with the code ..and it is beautifull!!!!…just a question: there is a way to redirect the complete video(webcam + 3d objects) to external devices (like dv cam)just to record all the animation?..its possible????
thanks!!!
lellosan
Mar 11th, 2009 at 02:42 AM
How do you make the model file ?, in the examples you use .DAT file format but the papervision works around .DAE what are the difference ?
pete
Mar 11th, 2009 at 08:30 PM
1st of all great work, i have been playing around with the FLARToolkit for the last week. I have a question however, i am loading in a 3D scene, but it doesn’t align correctly with the marker, when i move the marker the projected scene doesn’t stick, the alignment looks way off. How do i make the scene stick to the marker?
If anyone has any suggestions i would really appreciate some advice/help.
Mar 12th, 2009 at 12:36 AM
Really great work Saqoosha :o
Is there someone who tested with Sandy3D or others flash 3D engines instead of PV3D :x ?
Mar 12th, 2009 at 03:20 AM
Great work, I’m loving it and so far all is working great. Only thing is I want to change the line
var fmat:FlatShadeMaterial = new FlatShadeMaterial(light, 0xff22aa, 0×75104e);
to something that will allow for a jpg file to be the texture instead of the flat color. I’ve tried numerous other ways but just can’t get it to work! Any help anyone! pls!
Mar 14th, 2009 at 07:29 PM
hi, is customizable? i try to change a object but i need an hand to do it….so if i want to put a text ox another ed object from 3dstudio max how can i do? thanks a lot!!:)
Mar 14th, 2009 at 07:30 PM
hi, is customizable? i try to change a object but i need an hand to do it….so if i want to put a text ox another 3d object from 3dstudio max how can i do? thanks a lot!!:)
Mar 15th, 2009 at 05:05 PM
[...] 盾を装備しました。 おかげさまで防御力が20くらいアップしました。ありがとうございます。 盾って意外と思いのですね。 で、初FLARToolKitを触りました。 Saqoosha先生のFLARToolKit スタートガイドを熟読し、その記事中の一式ファイルをダウンロードしました。 [...]
Mar 15th, 2009 at 11:25 PM
how i can change the objet? in this case is a cube if i would to put my 3dstudio object ? i export my 3dstudio in .DAE but i don’t know how i put this .dae!
Mar 17th, 2009 at 01:24 PM
dino, you should check out flarmanager, it really makes hooking up models from different formats quite easy. also check out this post describing how to import multiple file formats to papervision.
http://marcpelland.com/2009/01/29/using-papervision-object-parsers
Mar 17th, 2009 at 07:38 PM
hi, joe i’m not have more skills abput flartoolkit. could i see how i link the file .dae? in this flartoolkit starter file i added this function
protected override function onInit():void {
super.onInit();
var object:DAE = new DAE();
object.load(’some_collada_file.dae’);
_baseNode.addChild(object);
}
on the Simplecube.as, but doesn’t works….
Mar 18th, 2009 at 10:55 PM
hi, we have an animation that’s working well, but it’s very sensitive to moving the marker. It there a way to set this type of sensitivity?
Mar 20th, 2009 at 02:49 AM
anybody help me how i can export .dae file on ed studio max? i try to export but i can see only the poligon and not a texture…!! thanx
Mar 20th, 2009 at 02:49 AM
anybody help me how i can export .dae file on 3d studio max? i try to export but i can see only the poligon and not a texture…!! thanx
Mar 30th, 2009 at 07:45 PM
Hi, I’ve downloaded the files and published the .fla file without any changes, but nothing will load on the screen. The webcam is connected, and i did [right-click => setting => Camera] and the setting is correct, but it still just shows a blank black screen.
How can I get this to work?
Mar 31st, 2009 at 04:38 AM
my flartoolkit works offline but when i try to publish online the swf doesn’t start…anybody can help me?
Apr 1st, 2009 at 06:38 AM
My problem is that the swf will only run in the directory it is created in. Even moving everything to a new location fails. How can I put my project up on the web?
Apr 1st, 2009 at 09:59 PM
Never mind. Newbie mistake on my part. It’s working fine now.
Apr 3rd, 2009 at 06:05 AM
great work guys…
need to trace something when the 3d object its on scene… any advise?
Apr 8th, 2009 at 10:09 PM
Hi,
Congratulations for this great job;) I would like to know how can I
change the object? In this exemple is a pink cube, but if I want to put a 3D object? Wat do I have to do and how? thanks a lot:)
Apr 9th, 2009 at 03:35 PM
[...] 使用指导(可惜是日文的):http://saqoosha.net/flartoolkit/start-up-guide/ 然后就有了下面的一些DEMO: [...]
Apr 10th, 2009 at 12:18 AM
[...] よし、来年の年賀状これでいこ!ってできんのか?俺。。。 とりあえずSaqooshaさんのところから、、、 (0) [...]
Apr 10th, 2009 at 03:42 PM
[...] 乗せると以下のようになります。 PV3DtoFLARToolkit 上 : -Z軸 下: +Z軸 右 : +Y軸 左 : -Y軸 正面 : -X軸 奥 : +X軸 座標関連はSaqoosha.net :: FLARToolKit スタートガイドを参考にさせていただいています。 [...]
Apr 12th, 2009 at 03:46 AM
Hi! great article. now i’m trying to make “plane” with movie material. it works, but i dont know how to play animation in my movie only when marker is detected and pause when not detected. Please give some idea, please please please))
Apr 14th, 2009 at 09:52 PM
Hi again,
Is it possible to load a SWF file or a FLV file into the FLAR application?! thanks a lot:)
Apr 15th, 2009 at 05:42 AM
Hi Renata, I think it is possible, try making a texture in the library with a movieclip, and load the texture into your model in pv3d
Apr 15th, 2009 at 06:15 AM
Nice I will try to do this, just in case works I will telt you know;)
But, how can I load a 3D animated (.md2 file format.) in the gihyo examples. thanks a lot again :)
Apr 21st, 2009 at 03:04 AM
mike w, how did you worked that out? i also have the same problem
thanks :)
Apr 21st, 2009 at 03:48 AM
Hi Dino,
Did you solve your problem? I’m having the exact same issue. The app works fine on my PC, but on my webserver the webcam security question doesn’t even pop-up..
Thanks!
Apr 21st, 2009 at 06:23 PM
diogo, if you discover what the problem is please post it here, im also trying to figure how to take this thing online
Apr 30th, 2009 at 01:25 AM
WOW! how can I get the the moment which the marker is recognized and my graphics appear on monitor?
May 5th, 2009 at 05:16 PM
i wanna to know how can i add one more marker and 3D obj on a same stage.
thz a lot!
May 10th, 2009 at 09:17 AM
col: 9 Error: Access of possibly undefined property useProjectionMatrix through a reference with static type org.libspark.flartoolkit.pv3d:FLARCamera3D.
this is the error msg I get…how can I fix it??? any ideas?
May 15th, 2009 at 03:17 AM
Guys, when I compile .swf this error comes up:
TriangleMesh3D.as, Line 275
TriangleMesh3D.as, Line 276
TriangleMesh3D.as, Line 277
It’s urgen, can someone help me whit this .. publish setting is fine .. etc .. Don’t know were to look at it.
Thx.
May 19th, 2009 at 04:31 PM
hi, is it possible to display a movieclip instead of a 3d object?
May 19th, 2009 at 11:41 PM
lol
i`m afraid few questions get answered here.
I have some super simple questions.
how was this fla made? is there a link to the .as files that are in the folder?
I`m trying to understand the basics.
Once again, thanx saqoosha for the starter kit!
May 20th, 2009 at 10:40 PM
Hello!! Does anyone have any coding for switching designs using a combo box? I keep getting error TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-2194()
May 25th, 2009 at 07:03 PM
Hi,
I’m sorry but my english is very bad,
i used for few days the FLARtoolkit to realised an Augmented Reality
project. It works very good but i would like to do a new thing. I
explain :
I would like to import a 3D object in my scene without the pattern and
an other 3D object with a pattern (AR) and if we move the 3D object
with his pattern the first 3D object get the direction, turn around
him, in the direction of the pattern, where i move my pattern.
I think i can use the function “get Direction()” like this :
firstobject.RotationY += detector.getDirection()
But my 3Dobject move in all direction but not in the direction of the
pattern.
So if you have an idea or a correction to my code or a new explain of
my project answer me.
Thanks.
May 27th, 2009 at 12:58 AM
[...] FLARToolKit マーカーから物体が現れるんじゃなくて、マーカーの位置に物体を移動させたい。 (ご本人様による解説) その物体とは、BigDog! このアニメーションの方が時間がかかってい [...]
Jun 2nd, 2009 at 11:23 PM
Hey guys im trying to do this with a movie clip on a 3d cube, ive tried using a videostreammaterial and a standard bitmapdata, for the movie clip texture however both times the cube just doesnt render, i know its streaming the video as i get audio and i know the tracker works as a cube using flatshadematerial works
any ideas?
source code is visible at http://www.zombievsshark.co.uk/arvideo.txt
thanks in advance
Jun 3rd, 2009 at 02:30 AM
^^^ ignore this, was calling the papervision init before the video init, doh!
Jun 5th, 2009 at 12:51 PM
Hey guys…..
has anyone figured out the issue with taking this online…..i seem to be having the same problem as Dino and Mike W. Any help would be great, cheers guys.
Jun 6th, 2009 at 06:02 AM
Hey christian and all,
I’ve been working on this for the last semester of school and am unable to embed the flash video (.swf) in a webpage. I don’t know if it’s my html that’s the problem or what, but if you try to access the .swf directly it works great. I don’t know what the problem is there. For example instead of going to http://www.test.com/index.html you could go to http://www.test.com/ar/testAR.swf and it will load the video. I know this is long, but I’ve been working on getting multiple markers working and it doesn’t want to work if anyone is interested I can send some source code out there.
Jun 9th, 2009 at 12:38 AM
hello plz can u help me to download flartoolkit?i can’t do it and i don’t know why! :(:(:( thnks a looooooot
Jun 9th, 2009 at 10:57 PM
Hi,
I have a problem. I opened the flar toolkit starter and it works fine, then I tried to import .dae object, and I can load it but without the texture. I’m using Fl CS4 and blender to create dae. I don’t want to use material list. Is it possible to use different 3d software, that works with flar?
Jun 13th, 2009 at 12:43 AM
Thank you to do an great effor on creating FLARTOOLKIT, it’s really help me to do my artwork! I’m come from Tiwan. And if I finish my work, I’ll share it to you! Thank you again!
Jun 16th, 2009 at 06:52 PM
@ amish, I use 3DS max 9 with the Collada plugin and export to .DAE it works a treat just use an XML editor to correct your paths for your materials.
Jun 17th, 2009 at 02:03 AM
@ Jamie, could you send me the code, and the object? I’ve tried with dae, and collada parsers and just don’t know why i can’t run it. I’ve downloaded few ready projects, but non of them worked with textures on my machine. alpuzyna(at)gmail(dot)com
Jun 25th, 2009 at 10:30 AM
Hello, I have CS3 professional and I have tried tpo open the flartoolkit flash componet up but I keep getting an error. unexpected format when I try to open this file. Can some one tell me how to get this working. I need some assistance I am new to this.
Jul 10th, 2009 at 10:06 AM
Thanks!!!!
Jul 14th, 2009 at 10:57 AM
hello, i´m a brazillian programmer, i´m sorry but my english is poor… Can You help me? I need more explications about how create other forms with papervision3d and flartoolkit, or how i can to create this models in other program and export to the flartoolkit, thanks…
Jul 20th, 2009 at 05:09 PM
Thnx for everything!!! But when i tried it on windows OS it worked perfectly, but when it was running on a Mac OS the camera stayed black. Is there something else i need to know?
Jul 24th, 2009 at 09:12 PM
Hey
Thanks for sharing your works. Amazing..
I like to know the possibility of making the 3d Object interactive i added click even listener it works fine with papervision but not when implemented in FLAR Im using AS3/CS4
Any help fingers crossed
Aug 19th, 2009 at 05:14 PM
Hi Saqoosha you did a good job here! ;)
My only problem here is that I can’t get the FLARToolkit files from the repository (I use tortoiseSVN). It is asking for username and password…how can I do?
kore wa yabai! boku o tasukete kudasai…;)
Sep 8th, 2009 at 10:40 PM
how to add your own collada model, for us newbies..
scroll down the discussion part..
http://www.vimeo.com/3780791
Sep 21st, 2009 at 01:50 AM
hi! how do you add more than 1 object?
my aim is to have 2 identical objects at the same time with 2 identical pattern images
Oct 4th, 2009 at 03:37 AM
Hi! Very excited about FLARToolkit but I’m having the same issue mentioned above when I publish the .swf:
1067: Implicit coercion of a value of type org.papervision3d.core.geom.renderables:Vertex3D to an unrelated type org.papervision3d.core.geom:Vertex3D.
Oct 4th, 2009 at 06:06 AM
My mistake. It turns out I had a 1.5 version in my class path. I simply went into preferences > actionscript > actionscript 3.0 settings to get rid of the file.
Off to make some interactive experiences! :)
Thanks.
Oct 21st, 2009 at 04:24 PM
I want to change the cube by a sphere what to do could you response.
Oct 23rd, 2009 at 11:11 PM
[...] FLARToolKit スタートガイド|Saqoosha.net [...]
Oct 25th, 2009 at 02:58 PM
Dear Saqoosha,
Your job is great.Can it Detect the natural marker?
Nov 24th, 2009 at 03:26 AM
Thank you so much. Love this tutorial very much. This is a really good start for me to learn FlarToolkit.
Nov 27th, 2009 at 05:36 PM
Thanks a lot man for sharing your knowledge with us. This world needs more people like you.
One
Dec 1st, 2009 at 09:32 PM
Hey Everyone,
I’m using the startup files as a template. I’m having troubles importing a custom pattern. The only pattern it will recognise is saqoosha’s. I’m using the torataro generator? Any ideas?
Cheers,
Dec 8th, 2009 at 03:41 AM
marker generator
Dec 15th, 2009 at 06:39 PM
what should i do to include animated 3d model? just create loop animation .dae model?
Dec 16th, 2009 at 03:04 AM
To get the examples working on the server you need to add the following mime types to your server:
.dae text/xml
.pat text/plain
.dat text/xml
Or you can simply change the .dae .pat .dat file extensions to xml. You will need to modify the file extensions in the code as well.
Dec 21st, 2009 at 01:03 AM
[...] のFLARToolKit スタータキット [...]
Jan 16th, 2010 at 08:19 PM
Hi,
This has made AR so simple.
Can you also help me in porting this to Nokia N97?
I tried to publish this to Flash lite as is, but it doesnt seem to work.
Would appreciate any help.
Thanks.
Jan 26th, 2010 at 11:59 PM
[...] FLARToolKit スタートアップガイド [...]
Feb 5th, 2010 at 05:04 PM
Hi everybody!
Could anyone please tell me that how should i place a model(3D Display object which does not associated with any marker) right after the last marker ?. I have tried x,y and z coordinates of last marker to map my model next to it but it does not help me. Please give me a solution as soon as possible. I have been dying for it last two days.
Note : I am using flar manager for multiple marker.