
Lately I’ve been trying to make some time to play around with FlarToolkit. If you don’t know what FlarToolkit is, FlarToolkit is an open source code library for Augmented Reality in Flash. I explain it more detail here in this post.
For this post I decided to however explain how to start developing with FlarToolkit. FlarToolkit is a bit harder to pickup and just run with because almost all of the commenting in the code is in Japanese so if you want follow the code (and you do not speak Japanese) you really have to sometimes dig deep and read carefully.
Before you go any further download this example. It’s basically Saqoosha’s simple cube example but just simplified a bit for readability.
Now let’s get started on FlarToolkit:
Step 1: Download
The very first time I went to Saqoosha’s blog I wasn’t even using the Google Translater to translate the page but I saw three familiar letters “SVN”. HAH… I got very excited to be able to download the entire FlarToolkit.
Download FlarToolkit from the following url:
http://www.libspark.org/svn/as3/FLARToolKit/trunk
If you’ve never used SVN before please check out this link. It explains how to download Papervision so just follow everything else but use the link above.
Step 2: Inspect
This is what I do when I’m trying to learn how to use some particular library. I begin by looking at examples or inspecting the code library. I’ll try to summarize what I’ve found out while inspecting FlarToolkit.
I started out following Saqoosha’s SimpleCube example. I personally did not like how it was written for an example app. (although for re-usability the way it is written is pretty good) In that example there are three classes ARAppBase, PV3DARApp, and finally SimpleCube.
Each of the 3 classes handles one part of the AR app but it’s hard to follow because PV3DARApp extends ARAppBase and SimpleCube extends PV3DARApp. So for simplicities sake I combined all these 3 classes into one class. (less re-usable easier to follow)
If you didn’t download the example above download it now
There are 4 parts to a Flar app.
1. Camera parameter file
2. Marker file
3. Marker detector
4. Flar Base Node
5. Papervision
Camera Parameters
The camera parameter file is a binary file that is loaded in. I had no idea at first what this file was about, but I went on Saqoosha’s blog and asked him what this is all about and he sais it’s a file that comes from a program that comes with ARToolkit. (the original original app FLARToolkit was ported from) The program that generates these files is called “calib_camera2”.
Calib_camera2 creates the binary file and the data from that binary file is used to correct lens distortion from your webcam. You can download that program here, however I think using the same “camera_para.dat” that comes with FLARToolkit should be fine. (I’m guessing this is what most people are doing)
Marker File
The marker file is a pattern that Flar will look for from your webcam. If you open up the marker file, mine is in “lib/mikko.pat”, you’ll notice that there are four 16×48 matrices. This is your marker from 4 different directions. Flar sees your marker as a 16×16 2d barcode. In the file each matrix is 16×48 because it’s actually 16 by 16 times three colours (red, green, and blue).
Saqoosha has created an Air app for creating these marker files. You can download that Air app from here.
Then follow the following steps:
1. Design a marker using the following specs. You can put whatever you want in the middle of the square although I think some shapes work better than others so experiment.

2. Print out the marker open up the air app and point the marker at your webcam. When you get a red square around your marker hit “Save Pattern” and you’re done.
Those two files were one of the biggest hindrances for me to start developing with FlarToolkit. I’ve always been one of those people who wants to know how things work and just going about without knowing what these files were was killing me.
Marker Detector
The marker detector will simply just look through your BitmapData you are drawing from the camera and look for the marker pattern defined in your marker file. Once it finds your marker it will let you know it found the marker and then give you a “confidence” percentage for finding your marker. After this you can get a translation matrix to manipulate your Flar Base Node.
Flar Base Node
The Flar Base Node is just a Papervision DisplayObject3d that you can throw your 3d stuff into (in my example’s case a plane and a cube). You will apply the transformation matrix received from Marker Detector to make your 3d stuff look right.
Papervision
This is the last piece of the puzzle for a Flar app and really I don’t want to go into too much detail about this one. If you are interested in Papervision just go on Google and look for Papervision. There is a ton of information on Papervision out there.
SOME GOTCHAS
I’ve found two gotchas when developing with FlarToolkit so far.
1. The very first time you try to compile FlarToolkit after getting Papervision even the examples will not compile and you will get this error message:
Error: Attempted access of inaccessible property _projection through a reference with static type org.libspark.flartoolkit.pv3d:FLARCamera3D.
To fix this just go into the class-
org.papervision3d.cameras.Camera3D
And change the line-
private var _projection:Matrix3D;
to
protected var _projection:Matrix3D;
This will not break Papervision however it will just allow FlarToolkit’s FlarCamera3D to use the projection matrix of the Camera3d class.
2. This is a gotcha where I’m not even sure what is going on. For some reason you have to set the Papervision viewport to be twice the size of your video. If you do not do this your rendered 3d scene will not line up with your video from the webcam. Even after you’ve done this, things still don’t seem to line up perfectly. In Saqoosha’s example he offsets the viewport by another -4 pixels. I didn’t really feel like doing this because I didn’t want it to confuse anyone anymore than scaling up 2 times might.
Now the rest is up to you. I’ve commented my code thoroughly so it’s quite easy to follow. I hope this post has filled in some of the blanks about FLARToolkit development. If you have any questions please feel free to ask below. I don’t know all the answers because I’m learning this stuff too but I’ll try to do my best to answer them.
262 Comments, Comment or Ping
Very nice post! I always wondered about the mysterious .dat and . pat files
December 5th, 2008
Thanks for the feedback Alex.
Do you have any of the stuff you’ve done online somewhere? I’d definitely want to check it out.
December 5th, 2008
Thanks for shedding some light on this FlarToolkit, because it ’s been pretty confusing analyzing the code for me.
I see your Main class extends Sprite. So I was wondering how to use this code in FlexBuilder? How to properly use it in mxml file.
Keep up the good work.
December 9th, 2008
Hey Nil.
I’m not super familiar with Flex itself. I use Flex Builder for my actionscript editing but Flex itself I haven’t worked with.
However I can make an educated guess. There must be a way in Flex to be able to throw new objects on stage/screen. So it should work if you instantiate the Main class and throw it on screen.
But like I said I haven’t done any flex work.
Ok ok… I just talked to one of my buddies here at Jam3 (he’s had a little bit of Flex experience) and he said you have to create uicomponent and add the Main class in there. Hope that made any sense or hopefully it’s getting you in the right direction.
December 9th, 2008
Oh Chris (buddy from Jam3) also said you can use:
rawChildren.addChild();
December 9th, 2008
I got it to work like this, if anyone is interested.
ActionScript:
private var camDisplay:Main = new Main();
public function init() : void
{
holder.addChild(camDisplay as DisplayObject);
}
And then I just added this in mxml:
December 10th, 2008
It looks like xml tags escaped the comments
“”
December 10th, 2008
Hello Mikko,
Thanks for the great start to FLAR; this stuff is pretty amazing
December 11th, 2008
Hey Tyler… No prob dude. Unfortunately I probably wont be able to post some cooler examples of FlarToolkit until well into the new year. I’m going to be visiting Finland from Dec 17 to Jan 7 and I’m ultra busy with work right now.
If anyone else is doing something cool I’d love to see it.
December 11th, 2008
I’m creating something right now implementing this with the Wiimote + Papervision3D, once i’m finished with it i’ll post the source.
December 11th, 2008
Hi all,
For a school project, me and a couple of others are trying to make a game based on this flartoolkit and papervision.
We did some research on Artoolkit before, but because none of us have any programming experience with c+ we switched our project to Flartoolkit. Because all of us do have experience with actionscript.
What we are trying now is to implement one of our own models into Flartoolkit. But we are already stuck at the part where you have to start the “Air” app for the marker.
We’ve downloaded the air application and saved in in the same map as Flartoolkit. But we do not know how to open this application..? You cannot open it with Macromedia Flash for example…
We already made another marker.. and created some models.
I’m sure this is really a noob question. But we are really .. really stuck…at the moment.
Can someone please help us?
December 18th, 2008
Duude! Great explanation for us not yet japanese speaking and reading dudes,
i love this kinda stuff!
hopefully they will optimize pv3d v2 so it ‘ll run with detailed geometry..
Thanx man
December 19th, 2008
You need to import these project files into Flex Builder:
http://www.adobe.com/products/flex/
For the marker application you need to have Adobe AIR runtime installed:
http://www.adobe.com/products/air/
If you need more help, let me know.
December 19th, 2008
The second gotcha seems to be due to the camera_para.dat you are using… I created one using the two step calibration (http://www.hitl.washington.edu/artoolkit/documentation/usercalibration.htm) and It seems to be quite right.
December 19th, 2008
Thanks so much for writing this tutorial. I was having a ton of trouble looking through the svn stuff on my own. I have an issue with your example and it is one that no one else seems to be having…
I’m running your Main.as file as my document class and when I go to compile, I get the following error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
It occurs on line 82 where you do new CameraParameters as ByteArray. Once again, I seem to find some issue no one else is having. Any suggestions or clues?
December 23rd, 2008
I’m guessing my issues stem from using the Flash IDE. I’ll try using Flex Builder and an AS3 project to try things out. I read (twice before it penetrated my head) that embed isn’t supported in the IDE… doh!
December 23rd, 2008
Finally got it fixed. Can’t wait to share some of my work here on the form. Take care!
December 23rd, 2008
Burton I’ve got exactly the same problem !
I’ve got the same error in the Flash IDE , and I don’t know how to use the Main.as file in flex 3 … can you tell me how you did to fix ?
December 27th, 2008
hey i am try to use this code and understand but how should call class file in flash. can you just give and example to integrate class and create a final project
January 7th, 2009
Hi Mikko,
I just wanted to say a huge Thank You, for writing this post. It’s very helpful, and has me even more excited to get cracking, now that I don’t have to Google Translate every comment in the code, ha. Also, for pointing me towards the pattern AIR app, that is very helpful. I had tried using another one online, but it was very buggy and error prone.
Thanks again!
Dan
January 7th, 2009
Hi,
I’m asking me how you created the SWF, there’s no FLA File in your example.
And something more…
1. I have changed the mikko.pat to my own Pattern but this won’t work, do i have to compile a new SWF?
2. Can’t find the Codeline where the 3D Objekt is to change or where to dinf the file…
January 11th, 2009
Hi,
I have downloaded the example but its not showing any output
Only the camera gets activated
Please let me know do we have to do any configuration for running the tool.
Thank You
January 12th, 2009
Ok, i think i got a bit more knowledge.
i have created a FLA with this Code
“import Main;
new Main();”
But i get this Error in Output
“INFO: Papervision3D Public Beta 2.0 – Great White (20.08.08)
Error
at org.libspark.flartoolkit.utils::NyObjectStack/prePush()
at org.libspark.flartoolkit.core.labeling::FLARLabeling_BitmapData/labeling()
at org.libspark.flartoolkit.core::FLARSquareDetector/detectMarker()
at org.libspark.flartoolkit.detector::FLARSingleMarkerDetector/detectMarkerLite()
at Main/mainEnter()”
And I don’t see anything with the Webcam, but it’s active.
January 12th, 2009
@Psk Flar can be a little bit picky sometimes. You may not see anything for the following reasons:
1. You have the wrong pattern file
2. Flar can not see your pattern because
a) Your marker is slightly bent
b) The room is too dark and Flar can not find the marker
3.If check that a error is not being thrown after the camera is on screen because the app may have crashed but it is still showing the camera
January 12th, 2009
Hey Markus… You don’t need Flash to compile “Flash files”. A lot of developers use some other compiler besides Flash to compile their flash files.
I use Flex Builder and Flash Developer sometimes and sometimes I just use plain old Flash to compile flash files.
If you are using Flash just stick main as your Document class.
January 12th, 2009
@Mikko Haapoja
Hi,
I guess their was a problem in Confidence value which was returning NaN.
Also here it was throwing exception.
if(this._sizeCheckEnabled)
{
if (!this._bin_raster.getSize().isEqualSizeO(i_raster.getSize()))
throw new FLARException();
}
finally it worked
Please let me know why the Cube is not moving along with marker i.e even though we remove the marker still the cube persist.
Can we speed up the program .
January 13th, 2009
can you post the flash source with the .fla included for us non flash IDE users? thanks in advance
January 13th, 2009
Hi
I observed one strange behavior i.e this program scans only for a rectangle and not for a specific pattern.
In my example i have linked mikko.pat but even if i use ‘hiro’ as marker it works.
Also
The cube doesn’t move with the marker, it gets switched to another position where ever it finds rectangle like shape.
Has anybody faced this problem?
If yes,What shall we do to remove this?
January 13th, 2009
Hi Mikko, thanks for your help with FlashDevelop it works now, i was wondering which is “.as3proj” extension.
Did you ever worked with the Max3DS Parser? I’m trying to add an Object with this parser, but still not working at the moment.
January 13th, 2009
I got the same error as Burton:
I’m running your Main.as file as my document class and when I go to compile, I get the following error:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
It occurs on line 82 where you do new CameraParameters as ByteArray.
I’m using flew builder, as3 project.
Any ideas?
Thanks!
January 14th, 2009
And it’s working perfectly with flash develop and flex sdk3 win xp.
Flex builder create always problems in fact, Flash develop should be on macOS. The webcam is on my mac!
Anyway thanks!
January 14th, 2009
Ok, it’s working now, problem was the folder, I placed my Object in the “src” folder, but the root folder is not the “src”, it’s the folder where the “as3proj” File is also saved.
Now I’m gonna Fight with the Materials and Textures, I don’t See any Shadows on my Object, i think it’s because there is no light. It’s only a big red Item without.
January 14th, 2009
Hi Mikko,
Your tutorial is great! I just get my hands on the SimpleCube code and start to create something of my own.
I tried to get the rotationX, rotationY and rotationZ from the baseNode, but seems FLARToolkit directly parse the transform matrix from the detector to the baseNode. Is there any ways I can retrieve the rotation from the transofrm matrix.
Thanks
Henry
January 19th, 2009
sorry, but i still dunno how to use ur example file. i saw a FlarTesting.as3proj, but how do i use it?
and there’s a Main.as file, but if i link it as document class, i get the error same as MARKUS,
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Main$iinit()
i’m using Flash 8 now. can u give me some guide on how should i use ur files? thanks.
January 20th, 2009
hi,
I’ve been reading through the code and slowly understanding it. Still confused a lot mind.
Im curious about how and where you would put code in to bring in your own pv3d animation/render?
anyone know?
January 21st, 2009
@Jon You should add in whatever you want to be rotated/translated by FlarToolkit to be in the main container. (I think that’s what I called it). Basically instead of the cube getting added into it add In whatever you want.
There’s been a lot of people been asking how to use my code with Flash. Please set the document class to be Main and then you can just hit ctrl+enter to view it. Just Make sure your .fla sits in the same folder as main.
January 21st, 2009
Same error here:
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at Main$iinit()
January 21st, 2009
Hello,
I’m completly new to FLAR. I have 2 questions:
-> How do I import a 3d-model that I made myself
-> How do I set up the fla so that I can use the 3d model
Maybe some one can give an example of an fla file.
Sorry for my horrible english.
January 24th, 2009
2 things,
anyone know why the video output has to be 640 x 480?
and has anyone figured out why that when you remove the marker the render still stays on screen?
January 24th, 2009
@John
For me the same. I now have a hd-cam as an webcam and try to scale the movie 2 1980×1080 but when I do that the model “cube” is no longer visible.
Any one with an id.
January 26th, 2009
Yes I have the same question as RogierMars.
I got the example running, but need to know how i can put my own Papervision 3D model into Flartoolkit.
Thanx alot!
January 26th, 2009
@arjan
To get your own papervision3d models running in FLAR you have to work the code into the right sections.
the main bulk of the render code goes in after the papervision light code. Thats where the code for the cube is. Replace that with your own.
Remember to include the appropriate links at the top of the code too.
completely new to papervision3d but im learning.
January 26th, 2009
Hi there,
So….another question about that damned error message. I set up the “class path” in the actionscript 3.0 settings in flash. It seems recognize the main file and flash can take me to the file to go edit if I want. So, when I publish it seems like it should do something but it doesn’t.
I’m using CS3…do I have to have anything on the stage of the flash file? or the class should do all the work? I can see this is an up to the minute problem, but I too am very excited to figure this out.
You’re blog post will inspire a new generation of flash-y-ness.
January 26th, 2009
I did it. I have now my own collade model with actionscript on stage in flash cs3.
Now the last part. Maybe some one can help me out.
With the cam and video size on 640×480 the video is ver jittery (stotterig). But when I change the resolution to for example 1600*1200 the video is great only there is no model! Had some one the same problem and now an answer for me?
January 27th, 2009
Hi I am quite new to AS3 but am interested in this AR have followed the best I can but I am now getting the following error
Main.as,Line 1
1180: Call to a possibly undefined method addFrameScript.
package
any help would be great.
Ian
January 27th, 2009
@rogier
as far as i know the video has to be set at 640 x 480. Dont know why it doesnt like anything higher. I’ve done a bit of work with webcams before and I had to have it set at the same resolution to make it work native. The way i got around that before was to upscale the video which would most likely not work with AR.
If anyone knows how to make it work ill be glad to hear it.
January 27th, 2009
That video and website resolution is a rea pain in the ass. Well this week I will try to make it compatible with my sony hd cam so that I can have some hd resolutions . If some one as already an answer please let me know\
You people can reach me @ this place check daily
January 27th, 2009
Hey there Jon, thanx for your quick reply!
Have to be more specific though. After the papervision light code you say, where is see this:
var cube:Cube = new Cube(cubeMaterialList,
30,
30,
30);
cube.z += 15;
mainContainer.addChild(cube);
so when i want to load in a Collada of a cow, i have to replace it with:
cow = new Collada(“http://papervision2.com/wp-content/downloads/dae/cow.dae”);
cow.moveDown(100);
cow.scale = 3;
cow.pitch( -30);
default_scene.addChild(cow);
and offcourse add some lines at the top of the code? is this correct?
@Rogier, maybe you can tell me how its done, is see you got it working..
or mail me at: ros.arjan@gmail.com
thanx alot in advance
grtz
January 28th, 2009
@ ARJAN
Here’s a sample
//add dae object
//daeFile = new DAE()
//daeFile.load(“models/world-ani.dae”);
//daeFile.scaleX = daeFile.scaleY = .6;
//daeFile.scaleZ = .6;
//Setup container, add dae to container, add container to scene.
//universe = new DisplayObject3D();
//universe.addChild(daeFile);
//mainContainer.addChild(universe);
make sure that you import the dae classes
January 28th, 2009
cow code:
after the PV3D light code and before the mainConatiner.addChild(cow) code:
// create new Collada from URL, using original materials and scaled to 50%
var cow:Collada = new Collada(“http://www.tartiflop.com/pv3d/FirstSteps/collada/cow.dae”, null, 0.5);
and at the top with the import code:
import org.papervision3d.objects.parsers.Collada;
if you need more that i’ve left out heres the PV3D code i was working from. Just copy in the stuff you need.
http://blog.tartiflop.com/2008/09/first-steps-in-papervision3d-part-9-importing-and-working-with-3d-objects/
January 28th, 2009
Hi, I have tried this and got it working, I wondered if anyone knew how to use mulitple markers to load more than one model. thanks
January 28th, 2009
thx for this tuto…cheers
January 28th, 2009
Mikkoh, thanks for the inside look, most useful. I have got everything up and running with a 3d model. But……
Has anyone got any ideas on improving the models ability to “stick” to the glyph? If you look at the boffswana example it works much better. I noticed there glyph file is .hiro rather than .pat. I’m going to check the flartoolkit version, but wondered if anyone might have some useful pointers?
January 29th, 2009
@Phil Reeks
Did you already succeded with multipelmarker and for each marker an other model.
I hope so. If so can you post the code for me.
January 29th, 2009
This is a great tutorial, and compiles fine as a demo, but I also need help putting my own objects in.
I tried following Rogiermars advice and (after correcting a few errors), go this;
var daeFile:DAE = new DAE();
daeFile.load(“../lib/church.dae”);
daeFile.scaleX = daeFile.scaleY = .6;
daeFile.scaleZ = .6;
//Setup container, add dae to container, add container to scene.
var universe:DisplayObject3D = new DisplayObject3D();
universe.addChild(daeFile);
My import is just;
import org.papervision3d.objects.parsers.DAE
With this code I get the stream from the webcam, but *nothing* else appears. Not even the blue marker outline.
Theres no errors during compileing, so I assume maybe a runtime error.
My church.dae is in the right directory though, and I have tried with different dae files.
I also tried the cow code Arjan posted with the exact same lack of results.
Any ideas?
February 1st, 2009
So, I’m still caught up in the “TypeError: Error #1007: Instantiation attempted on a non-constructor at Main2$iinit()”
the CameraParameter “class” seems to be the problem, but I think someone stated the solved that problem but didn’t say how they solved it.
cameraParameters.loadARParam(new CameraParameters() as ByteArray);
does it have anything to do with the embed line “[Embed(source="../lib/camera_para.dat", mimeType="application/octet-stream")]” ?
February 2nd, 2009
I think “.as3proj” is Flex SDK?
February 3rd, 2009
@ RYAN.
It is indeed a flex project. If you develop is Flash cs3 you can’t use the code ““[Embed(source="../lib/camera_para.dat", mimeType="application/octet-stream")]””
I will send you a email with an attachment with the correct code and setup to import a DAE model.
So post your email and I will send you some stuff
Any one know how to use the MultiMarker class???
February 3rd, 2009
Could I have that email too? because the code I posted above dosnt work for me.
Oddly enough though, when I imported the project, everything worked first time.
February 3rd, 2009
My email is darkflame_at_gmail_d0t_com
February 3rd, 2009
Ok guys… sorry i haven’t been writting any comments for a while went on vacation over christmas got back and had to put out some major fires here at work.
I’m going to try to write some posts about how to do stuff in Flar in the next while so I hope I can answer these questions. (questions I’ve seen so far)
1. How to do this stuff in the Flash IDE
2. Collada and Flartoolkit. (own models in Flar)
3. Figuring out transformations coming from FlarToolkit.
Just saw some comments about .as3proj. The file .as3proj is for Flash Develop. I used Flash Develop for this project because it’s free and pretty good.
.as3proj is not a Flex SDK thing. Yes there are embed codes in there but thats because I’m using Flash Develop with Flex SDK.
For those of who are interested in what I use normally. I use Eclipse with the Flex Plugin and sometimes I use Flash IDE. But I don’t use the Flash IDE so much for coding.
February 3rd, 2009
Actually sorry. I NEVER EVER use the Flash IDE to code in. (and neither should you)
What I meant to say is I sometimes use the Flash IDE to compile.
February 3rd, 2009
several people complained about the
TypeError: Error #1007: Instantiation attempted on a non-constructor at Main2$iinit()” error
I had the same problem, so I took out the embed stuff and loaded the 2 files as below:
public function Main():void
{
/*
* cameraParameters will hold our parameters from the camera noted above.
* Flar will use the camera parameters to make your 3d stuff
* look right
*/
this._loader = new URLLoader();
this._loader.dataFormat = URLLoaderDataFormat.BINARY;
this._loader.addEventListener(Event.COMPLETE, this._onLoadParam);
this._loader.addEventListener(IOErrorEvent.IO_ERROR, this.loaderror);
this._loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.loaderror);
this._loader.load(new URLRequest(“../lib/camera_para.dat”));
}
private function _onLoadParam(e:Event):void {
this._loader.removeEventListener(Event.COMPLETE, this._onLoadParam);
cameraParameters = new FLARParam();
cameraParameters.loadARParam(this._loader.data);
this._loader.dataFormat = URLLoaderDataFormat.TEXT;
this._loader.addEventListener(Event.COMPLETE, this._onLoadCode);
this._loader.load(new URLRequest(“../lib/jon.pat”));
}
private function _onLoadCode(e:Event):void {
markerPattern = new FLARCode(16, 16);
markerPattern.loadARPatt(this._loader.data);
//Get our webcam going
cam = Camera.getCamera();
//Set the webcam to run as 640×480
//at 30 frames per second
cam.setMode(640, 480, 30);
as before ….
February 3rd, 2009
hey there
ya…my email is guidewire_at_gmail_d0t_com …
I was growing to be aware of the FLEXness of your project, but I figured it could be done similarly in flash. I got the impression that Flash Develop was charging. I went there and my quick scan suggested that….but maybe I should look closer. I am starting to realize that designing in flash IS a pain for coding. It would be nice to have something replace a bit more of the code.
Can you use Aptana at all? Anyone know about that?
February 3rd, 2009
Thanks a lot for posting the source, allthough I’m still having no luck
I copyied the lines to do with the dea model into the learningFlarToolkik version of the source (because I’d already made a .pat file that seems to work fine…dont know how to make a .hiro file).
So I basicaly got;
//add dae object
daeFile = new DAE()
daeFile.load(“../lib/world-ani.dae”);
daeFile.scaleX = daeFile.scaleY = .6;
daeFile.scaleZ = .6;
//Setup container, add dae to container, add container to scene.
universe = new DisplayObject3D();
universe.addChild(daeFile);
mainContainer.addChild(universe);
just above the lines placing the plane in the scene.
I also added the imports and the variables at the top, and moved the model to the lib directory.
Yet it still dosnt appear!
All I get is the plane appearing, aligned to the marker.
If I add something else like a cube to universe it appears, but no dea imports seem to work :-/
I dont get any error when compiling either :-/
February 3rd, 2009
@jon
hey thanks….flash seems to say that the “this._loader.load” is correct syntax…
any thoughts?
February 3rd, 2009
@jon
sorry…. inncorrect
February 3rd, 2009
Sorry, I am super-confused. I would like to get started with this, but I cannot even download the FLARToolkit or Papervision with Tortoise-SVN… it wants a login/password from me…!
How do I download this??
February 4th, 2009
Just wondering if it’s possible to change the video dimensions…I tried changing the dimensions but I loose the object as soon as i do this?
February 4th, 2009
@ DAN,
You can change the video dimensions. Just change all of it but not de capture video or else you have a problem. Code beneath:
private function verder():void
{
//Get our webcam going
cam = Camera.getCamera();
//Set the webcam to run as 640×480
//at 25 frames per second
cam.setMode(1024, 768, 30);
//Create a new video object to show our webcam
vid = new Video();
vid.width = 1024;
vid.height = 768;
//vid.x = stage.stageWidth/2-vid.width/2;
//vid.y = stage.stageHeight/2-vid.height/2;
vid.attachCamera(cam);
addChild(vid);
var masker:Sprite = new Sprite ();
masker.graphics.beginFill (0xffffff);
masker.graphics.drawRect (0, 0, 1024, 768);
masker.graphics.endFill ();
masker.alpha = .6;
addChild(masker);
/*
* capture will hold BitmapData of what is shown on the
* webcam FlarToolkit will use this bitmapdata to look
* for our mark pattern
*
* we will need to redraw vid to capture every frame
*/
capture = new BitmapData(640, 480, false, 0×000000);
capture.draw(vid);
February 5th, 2009
Make sure you change all the dimensions, its mentioned a few times in the script.
I halfed it to 320×240 and it still worked for me.
Well…aside from getting my own 3D model to work, but given placing a cube in code works, its clearly a different problem.
February 5th, 2009
I’ve got a working version of the simpleCube now…..it’s GREAT….woot. Now, Now, I’ve been trying to export some 3d models from blender….and haven’t had a great deal of success. I was able to import the cow from Saqoosha’s “new year” thing. Blender seems to export Collada 1.4 files…..and in the papervision docs it seems to say 1.4.1. Is there a big difference? Should they load the same?
Also, is there anything that you can do to maintain the image persistence? Right now when the camera looses sight slightly the graphic disappears.. Do any of you know where the code is for keeping the object around for awhile
Silly question.
February 5th, 2009
Hey Ryan…
I’ve seen this floating around. I haven’t tried it out but it looks quite neat.
http://www.rozengain.com/blog/2008/01/02/export-your-blender-objects-straight-to-away3d-papervision3d-and-sandy/
Export from Blender straight to Papervision without any collada parsing or anything.
As for the simple cube disappearing from what I remember it actually stays on stage. But FlarToolkit itself does not do anything fancy like remove the object when it looses the qrcode.
February 5th, 2009
Hee, Thanks for the tutorial!
I was wandering, is there an other way to create the .pat files?
For example with photoshop?
February 6th, 2009
Hey J-Wee you have to create the Pat file using the air app.
It’s pretty easy to use. What you do is create your pattern in photoshop using the guidelines in my post. Then print it out and run the air app which will generate you a PAT file.
February 6th, 2009
Any one known how to use a animation from a 3ds file in papervision with AR. I use an import of a 3ds file works fine only the animation is not there.
Some help please
February 7th, 2009
Hi Mikko,
Great AR tutorial. I stumbled upon it via the papervision blog. I also went to school with Nick @ Jam3. Small world…I’ve made my own custom pattern and loading in a collada works fine. The pattern is recognized by the camera and rotation works perfectly.
Problem is with aligning the model’s x,y,z or even a basic plane’s x,y,z to the pattern.
When I add a basic plane to the FLARBaseNode, it is offset by over 500 pixels. The offset is a lot better if comment out the code that doubles the viewport size, but still is not perfect. I know you were having issues to with alignment, but with a simple plane it’s still not even close to the screen shot you posted on your blog.
Does this have to do with the calib file? An earlier post in this thread mentioned the 2 step calibration that seems to help.
(http://www.hitl.washington.edu/artoolkit/documentation/usercalibration.htm)
With my luck the util files for calibration won’t run on a mac.
February 8th, 2009
Hi,
I have the same question as Rogiermars.
Please, anybody can tell us how to use an animated object instead of a still one?
My e-mail is: dragomir_cristian2004@yahoo.com
Thank you in advance gyus!!!!!
February 12th, 2009
Hello, Mikkoh.
so any help that you can give would be greatly appreciated – i am also working on cs4.
I am using the Main.as as my class, but it still does not work. I am getting a 1017 error with the byte array asset. I am not a developer s
Thanks
February 12th, 2009
Hi,
just wanna ask….any know how to solve the “this._loader” problem?? since it keep giving me the same error.
February 13th, 2009
fyi
more on camera calibration here:
http://www.hitl.washington.edu/artoolkit/documentation/usercalibration.htm
most off-the-shelf webcams have about the same amount of lens distortion, so using the camera_para.dat file packaged with FLARToolkit is usually fine. if you’re using a more-customized camera with more or less lens distortion, follow the instructions at the link above.
February 16th, 2009
oops, sorry, just read thru all the comments and realized the camera calibration link was mentioned a couple times before.
some additional thoughts — having worked with computer vision / fiducial tracking a bit before, i recommend not setting your video size to greater than 640×480. that’s asking a lot of flash player to process that many pixels every frame.
also, i’m guessing that, for those trying to change your camera resolution, especially if you’re changing the aspect ratio (@rogier, you’re changing to a much wider aspect ratio than 4×3), you’ll have to recalibrate the camera using the ARToolkit calibration tool.
finally, for those with the problem of your 3D shape not staying “fastened” to your marker, it sounds like the FLAR engine recognized your marker in one location, drew your shape, but then lost the marker.
some things to try to improve marker recognition:
- be sure that you have bright lights on and high black/white contrast in your video image
- in Main.mainEnter(), try lowering the minimum confidence value (currently not registering markers of confidence < 0.5). careful, lowering too far will cause the engine to recognize things that are not markers.
- in Main.mainEnter(), use a higher threshold value for the detector.detectMarkerLite() call. again raising the threshold too high will cause the engine to recognize things that are not markers. the max is 255, but you should never have to come even close to that value. the default is actually a bit higher (100).
February 16th, 2009
i haven’t tried this yet, but looking through FLARMultiMarkerDetector, it looks like the way to use it is basically:
create multiple .patt files, and embed them in your Main.as file.
note that they must all be the same size! (we’re using 16×16)
instantiate a FLARMultiMarkerDetector (instead of a FLARSingleMarkerDetector).
create an Array of N FLARTransMatResult instances (instead of just one).
call FLARMultiMarkerDetector.detectMarkerLite(); this will return the amount of detected markers. let’s call this amount N.
loop through that Array, and call FLARMultiMarkerDetector.getTransmationMatrix() for each FLARTransMatResult.
call setTransformationMatrix on all of your FLARBaseNodes.
the one thing i’m not yet sure about is how to tell which detected marker is which. ah wait. looks like each detected marker has a property called ‘codeId’, and you can find the codeId of each of FLARMultiMarkerDetector’s results with FLARMultiMarkerDetector.getARCodeIndex(). however, it’s referencing a variable that doesn’t exist. in FLARMultiMarkerDetector, change this line:
return this._result_holder.result_array[i_index].arcode_id;
to this:
return this._result_holder.result_array[i_index].codeId;
also, note that FLARMultiMarkerDetector has a bunch of trace statements in it that will likely slow down the application; it’s best to comment these out.
phew. sorry about the brain dump. next post is a code example. it’s *very* untested and incomplete, and only shows changes from mikko’s code.
February 16th, 2009
[Embed(source="../lib/mikko01.pat", mimeType="application/octet-stream")]
private var MarkerPattern01:Class;
[Embed(source="../lib/mikko02.pat", mimeType="application/octet-stream")]
private var MarkerPattern02:Class;
[Embed(source="../lib/mikko03.pat", mimeType="application/octet-stream")]
private var MarkerPattern03:Class;
public function Main () :void {
// init patterns and multi-marker detector
var patternClasses:Array = {MarkerPattern01, MarkerPattern02, MarkerPattern03};
markerPatterns = new Array(patternClasses);
for (var i:int=0; i<patternClasses.length; i++) {
markerPatterns[i] = new FlarCode(16, 16);
markerPattern[i].loadARPatt(new (patternClasses[i] as Class)());
}
detector = new FLARMultiMarkerDetector(cameraParameters, markerPatterns, 80, markerPatterns.length);
// init transformation matrices, used to report the results of marker(s) detection
transMats = new Array(markerPatterns.length);
for (var i:int=0; i<markerPatterns.length; i++) {
transMats[i] = new FLARTransMatResult();
}
// init base nodes
baseNodes = new Array(markerPatterns.length);
for (var i:int=0; i<markerPatterns.length; i++) {
baseNodes[i] = new FLARBaseNode();
}
}
private function mainEnter (e:Event) :void {
capture.draw(vid);
var numDetectedMarkers:int = detector.detectMarkerLite(raster, 100);
var markerId:int;
for (var i:int=0; i<numDetectedMarkers; i++) {
// ignore detected markers with low confidence
if (detector.getConfidence(i) < 0.5) { return; }
// figure out which marker we’re looking at
markerId = detector.getARCodeIndex(i);
// set the transformation matrix accordingly
detector.getTransmationMatrix(i, transMats[markerId]);
}
// apply transformation matrices to base nodes
for (i=0; i<baseNodes.length; i++) {
baseNodes[i].setTransformMatrix(transMats[i]);
}
//Render the papervision scene
renderer.render();
}
February 16th, 2009
ps. @mikko — thanks for the awesome tutorial!! wouldn’t have been able to get this far without your first steps, and the notes about the .patt files and link to saqoosha’s pattern generator are suuuper helpful.
February 16th, 2009
Hi
Thanks for this translation, most usefull.
Did anyone of you get this weird error message when trying to change the size of the display ?
Error: ??????((width=640 , height=480):(width=320 , height=240)
at org.libspark.flartoolkit.detector::FLARSingleMarkerDetector/detectMarkerLite()
at Main/::mainEnter()
320×240 is the size I have configured, and 640×480 the basic size
February 19th, 2009
Just this as need it to load a dae model
package net.saqoosha.flartoolkit.example
{
import flash.events.Event;
import org.papervision3d.objects.parsers.Collada;
import org.papervision3d.objects.DisplayObject3D;
[SWF(width=640,height=480,frameRate=30,backgroundColor=0x0)]
public class SimpleCaos extends PV3DARApp
{
private static const PATTERN_FILE:String = “Data/patt.hiro”;
private static const CAMERA_FILE:String = “Data/camera_para.dat”;
private var mCollada:Collada;
private var universe:DisplayObject3D;
public function SimpleCaos() {
this.addEventListener(Event.INIT, this._onInit);
this.init(CAMERA_FILE, PATTERN_FILE);
}
private function _onInit(e:Event):void
{
this.mCollada = new Collada(“tank.dae”);
this.universe = new DisplayObject3D();
this._baseNode.addChild(this.mCollada);
this._baseNode.addChild(this.universe);
}
}
}
February 21st, 2009
to create a model DAE I use swift 3d..an export to Papervision3d and just take the model not the .as file.
read and download this… is very easy..but you have to translate
http://www.cabanacriacao.com/blog/archives/papervision3d-augmented-reality-ligue-sua-webcam-e-curta-a-realidade-aumentada-pelo-flartoolkit-20/
February 21st, 2009
Great tutorial, thanks so much!
Has anyone had any luck with figuring out how to access rotation / orientation of a FLAR baseNode? I’m working on a project that needs to know about the orientation of the model (i.e. which way points “down” on the screen). Any help would be most appreciated!
February 22nd, 2009
great article, Creepy Smile
February 23rd, 2009
Hi Mikko
Thanks for the tut, very helpful. I am compiling your example with flashdevelop, and throws no errors, but the only think i have after allowing access for the camera is a white background. My camera is a sony minidv camcorder and i have tested with pages that use this toolkit and have no problems visualizing what they show.
Do you know what can this be?
Thanks in advance
Jose
February 25th, 2009
Ok solved, from inside flasdevelop does not appear but using the generated html file with the embbeded swf works. Security probably
Best
Jose
February 25th, 2009
hi, question on the “marker”, can it be a logo in black and white or does it have to be distinct geometric shapes?
thanks
February 26th, 2009
The marker must have the black border on it but inside you can have whatever you want although a distinct shape may work better.
February 26th, 2009
hey, have you found any problems with the threshold range? if you put some high value on that ( detector.detectMarkerLite(raster, threshold) …. ) like 128 and the camera is too bright it will run too slow :s have you had that problem?
February 27th, 2009
Thanks for your article.
But hey, cubes are not fun!
Were can I find a nice tutorial how to take the next step and use Sketchup or another 3D-program with the FLARToolkit.
Have you tried it? Please give us a link or a new article with a step by step tutorial.
I want to make my apartment in 3D and show it to the rest of the world.
Love
Ellie
February 28th, 2009
This is useful article.
Thank so much.
March 1st, 2009
How do I get the Boffswana sorce code up and running?
Wish file do I compile?
Help please.
//E
March 5th, 2009
Hi mikko…maybe you can help me with this… look
package {
import flash.events.Event;
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.MouseEvent;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.objects.parsers.Collada;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.materials.VideoStreamMaterial;
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.render.LazyRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
//import org.papervision3d.objects.parsers.MD2; //————————
[SWF(width=640,height=480,frameRate=30,backgroundColor=0x0)]
public class RASuite extends PV3DARApp
{
private var mCollada:Collada;
//private var mD2:MD2; //———————————
private var universe:DisplayObject3D;
private var plane:Plane;
private var _plane:Plane;
private var videoCristina:VideoStreamMaterial;
private var quality:uint = 8;
private var nc:NetConnection;
private var video:Video;
private var ns:NetStream;
public function RASuite()
{
this.addEventListener(Event.INIT, this.onInit);
this.init(‘Data/camera_para.dat’, ‘Data/patt.hiro’);
//plane = new Plane(videoStreamMaterial, 1600, 1200, quality, quality);
//plane = new Plane(videoStreamMaterial, 320, 240, quality, quality);
var customClient:Object = new Object();
customClient.onMetaData = metaDataHandler;
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.client = customClient;
ns.play(“cristina.flv”);
video = new Video();
video.width = 320;
video.height = 240;
video.smoothing = true;
video.attachNetStream(ns);
}
protected override function onInit():void
{
super.onInit();
this.removeEventListener(Event.INIT, this.onInit);
//Plano en lineas ————————————————–
var wmat:WireframeMaterial = new WireframeMaterial(0xff0000, 1, 2);
wmat.doubleSided = true;
this._plane = new Plane(wmat, 80, 80);
this._baseNode.addChild(this._plane);
//——————————————————————
//Carga Objeto DAE ————————–
this.mCollada = new Collada(“tank.dae”);
this._baseNode.addChild(this.mCollada);
//——————————————-
//——————————————————————
videoCristina = new VideoStreamMaterial(video, ns);
this.plane = new Plane(videoCristina, 80, 80, quality, quality);
this._baseNode.addChild(this.plane);
//——————————————————————
//this.mD2 = new MD2(“tris.md2″);
//this.universe = new DisplayObject3D();
//this._baseNode.addChild(this.universe);
//llama acciones externas—————————————-
this.stage.addEventListener(MouseEvent.CLICK, this._onClick);
addEventListener( Event.ENTER_FRAME, loop3D );
//—————————————————————
}
private function metaDataHandler(infoObject:Object):void
{
trace(‘metaDataHandler’,infoObject);
}
private function _onClick(e:MouseEvent):void
{
//this.mirror = !this.mirror;
this.ns.play(“cristina.flv”);
}
private function loop3D(event:Event):void
{
//_plane.x += ( ( -mouseX * 5 ) – _plane.x ) / 15;
//_plane.y += ( ( -mouseY * 5 ) – _plane.y ) / 15;
//this.ns.play(“cristina.flv”);
}
}
}
I hope you can help me!!!!!!
Thans you
March 6th, 2009
with FlexBuilder 3, does importing a Flex Project work, pointing it to the LearningFlarToolkit dir? I’m getting a project isn’t a valid Flex Builder project error..
tnks…great stuff
March 6th, 2009
hey mikkoh thanks for the beautiful download and instructions here.
i have a def noob question. i’d like to change the maker into one i did using the air application you suggested. however it’s not working when i put the file into the /lib folder if i change the name in main.as or even i rename the new.pat into the mikko.pat. it’s still working with your maker.
thanks a lot for helping me out.
daniel
March 7th, 2009
@danii Hmmmm wierd… If you are using flex builder or Flash Develop try refreshing the project. I know Flex builder will sometimes use the previous file if you do not refresh.
March 7th, 2009
@ rooster LearningFlarToolkit was a Flash develop project so create a new Flex Project copy over all the files from LearningFlarToolkit set Main (I think it was Main) as the Default Application and delete the default application that was created by Flex. (cause you don’t need it)
March 7th, 2009
Hi
Thanks for providing the files. It works fine as it is, but I’d love to play around with the code on my mac. I just can’t manage to transfer this flash develop project into a flex or flash project.
Has anyone achieved this yet? (Seems like i am not the only one with this problem)
If so, it would be really awesome if you could provide the flex or flash project files.
Thanks a lot
March 8th, 2009
hey there,
i wrote up a small framework to make using FLARToolkit easier.
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!
March 9th, 2009
Hi MikkO!!! very great work!!!
thank you!
..and now the question…. there’s a way to redirect final video output(webcam + 3d) to firewire dv cam and not to video DisplayObject on screen?
thanks!!!
lello
March 11th, 2009
@Noob
This comment has been made several times already…..
Just create a new fla file, save it in same directory as Main.as and in properties put Main as class. and there you go your file in flash, all the other stuff is AS 3.0
Nice Blog and tutorials Mikko keep up the good work.
March 11th, 2009
Hi, could somone give me a working template for flashdev and flex sdk for using this with a .dae model … i tried the the things posted here, im a bit in a under time pressure. Would be awsome.
Btw thx for sharing source and knowledge.
March 13th, 2009
Hi,
Mikko this example is great,
I’m newbie with flash and I only have one problem with the example/tutorial you posted.
Once I build the swf it seems to work only in the bin folder that was generated, if I move the swf to another folder it only shows the camera but it doesn’t render the object. Why it could be happening?
Thanks in advance!
March 23rd, 2009
I have the exact same problem as Diego. Everything else is working fine for me: I made my own marker, I’m using Collada objects: it all works fine, but as soon as I try to move the swf out of the bin directory, it only shows the cam, never the objects. I would like to upload my file to a web server, but this is hurdle.
Can anyone help?
Thanks
March 31st, 2009
Are you guys remembering to grab the collada file (if loading in dynamically) and the textures too? Although I think if it didn’t have the textures then it would show your model as black.
April 1st, 2009
Never mind. Newbie mistake on my part. It’s working fine now.
April 1st, 2009
Mikko:
Thanks for the reply. I was actually not uploading the models because I thought it wasn’t even working if I just moved it to a different directory. Then I figured out that it wasn’t working locally due to security issues. When I uploaded everything to the server it was fine. The lack of models on the server and the security issues caused the same result, so I was treating them as one problem when it was really two different things. I’ve got it now.
BTW: Thanks for your terrific efforts in making this technology more accessible to the rest of us.
April 1st, 2009
I must be doing something really wrong…
Even if I use absolute paths (eg: c\models\car.3ds) moving the swf or even the whole folder makes to stop working the rendering.
I even try changing the name of the bin folder and leave everything equals and also stops working.
Any Idea?
Thanks!
April 1st, 2009
Diego:
Your swf won’t work if you move it to another location (Even if you move the whole directory structure) because of security issues. Basically, the new location isn’t “trusted”. You can change that by right-clicking on an swf display in your browser and going to “settings” and “advanced”. From there, you can access the security settings. Browse for the directory the contains your entire project (i.e. the directory containing “bin”, etc”) and add it to the trusted sites. Then you can test your swf locally. You might also want to go back to relative directory paths in your code. Hope this helps.
April 1st, 2009
Hello!
so i am a complete newb at this stuf, so would it be possible to maybe jump on some sort or IM chat or something with me? i really want to get this to work & i think its awesome but i just dont understand alot of aspects of this project. Thank you,
Gabe Renfro
April 2nd, 2009
@Mike W. I think you’re talking about security sandbox issues.
It doesn’t quite work like that. If you are locally running a file in your browser and trying to load something from another server than currently where your Flash file is located then it will throw a security sandbox error.
eg. your flash file is on your desktop and it’s trying to load a collada file from a server.
I highly recommend everyone download and install the debug player for your browsers.
@Diego hmmm… yeah you should use relative paths ALWAYS. Also I just noticed your 3d file is of file type 3ds is it a collada file though?
April 2nd, 2009
MIkko:
You’re right, off course. I didn’t explain it very well and layered in my own situation to make it even more confusing. Thanks for the clarification.
April 2nd, 2009
Yeah no worries… Security sandbox issues are my worst enemy. It seems like they always pop-up at the worst time.
Like yesterday I was working on a contest entry for an FITC contest and my banner communicates to twitter. Of course twitter has a very restrictive cross domain policy and so I was left scrambling trying to think of a PHP proxy to communicate with twitter. Not fun!!!
April 2nd, 2009
Thanks in large part to your example here, I’ve been able to build my own demo that incorporates custom markers and models, keyboard and mouse control and programmatic animation (with TweenMax). I’ll be showing it to a group of educators at the university where I work in about a week. We’re anxious to get some dialog going about the educational uses of this technology.
Thanks again for your posts. They really help.
April 2nd, 2009
Mikoo, Mikew
I was having trouble with some security issues as you guys said, I could solved that. Thanks!!
Very usefull the debug player, I didn’t know that exists.
I always use relative paths, I was using absolute ones for testing because I was not been able to identify the problem.
Thanks both of you for your great help.
April 6th, 2009
Thx to Jon for the tip about how to get this working through the Flash IDE. Loading in the camera params and marker file instead of embedding them worked a treat.
April 10th, 2009
Just wanted to say a big thanks for the source.
I was trying to using the Flex mxmlc.exe command line compiler. The default example code that comes with FlarToolKit had been giving me some strange package link errors, but yours compiled first time
Also your tutorial is very well documented, much appreciated. I’m completly new to AS3 but have been using ARToolKit for some time at work, the coments have made learning so easy.
Once again big thanks
Tom
April 14th, 2009
Fixed the screen size issue
For anyone having trouble with the fact that the vid size is being scaled by two I’ve found a fix.
I found it as I wanted to knock the cam res down to 320×240 to improve performace but it errors, so then I found
cameraParameters.changeScreenSize(vidWidth, vidHeight);
Set this to your desired value, then you can set the other sizes to the same.
Now you can remove
viewPort.scaleX = viewPort.scaleY = 2;
also improves the accuracy of the projection onto video.
April 16th, 2009
Yeah if you look at my newer examples I’m actually doing that. Well I think my camera param file is actually set to 320×240.
Also as a note… When you create your video object make sure you pass in the width and height because if you don’t and you do a draw to bitmapdata it will just draw at default size.
So in other words flartoolkit will be detecting your marker on a much smaller bitmapdata than it needs to.
April 16th, 2009
Hi Guys,
I’ve been able to put the Saqoosha FLARToolkit example working in my PC, but when I pass it online it doesn’t work. The flash webcam security pop-up doesn’t even appear, everything remains blank.
Do you have any ideas on what it might be? Perhaps some misconfiguration that needs to be done on the webserver? Something on the flash side?
Thanks in advance
April 20th, 2009
Hey everyone! Im trying to deploy a 3d model with the FLARtoolkit, but i need to display different animations at a time.
I mean, i need to play some animation when the model appears on the screeen, then another animation to stay lopping while the user has the patter in front of the camera, and a “closure” animation, when the user takes out the pattern…. just as I think the “GE SMARTGRID” have made.,….
Does anyone know how to accomplish that? Do i have to put into one collada all the animations and with code call one at a time (is that possible)? Or does it need to be 3 different colladas?
Im going crazy with this one pls someone help?
April 25th, 2009
sdefsdfsdsdgsdg
May 8th, 2009
this doesnt work anymore since that variable has been removed from Camera3D.as in papervision:
To fix this just go into the class-
org.papervision3d.cameras.Camera3D
And change the line-
private var _projection:Matrix3D;
to
protected var _projection:Matrix3D;
I get the same errormsg, but now I am not able to fix it…any ideas?
May 9th, 2009
A question:
If the marker isn’t visible for my webcam I would like the fact that my 3D object disappears (visibility: false). Does someone know a working way to program this?
Thanks a lot!!
May 11th, 2009
Can anyone tell me how to get this running in flash cs3? please
May 11th, 2009
I’ve trying to get the multi detector that Eirc Soco was kind enough to post but I can’t get this line of code to work:
var patternClasses:Array = {MarkerPattern01, MarkerPattern02, MarkerPattern03};
Here is a larger chunk of the code, the full one is posted above:
public function Main () :void {
// init patterns and multi-marker detector
var patternClasses:Array = {MarkerPattern01, MarkerPattern02, MarkerPattern03};
markerPatterns = new Array(patternClasses);
for (var i:int=0; i<patternClasses.length; i++) {
markerPatterns[i] = new FlarCode(16, 16);
markerPattern[i].loadARPatt(new (patternClasses[i] as Class)());
}
I am using Flash Developer with flex.
Any ideas?
Cheers!
May 14th, 2009
Oh yeah the errors I’m getting back for this line:
var patternClasses:Array = {MarkerPattern01, MarkerPattern02, MarkerPattern03};
is: expecting colon before comma.
and : expecting identifier before rightbrace.
May 14th, 2009
Hi,
I got the co- ordinates of the marker from flar toolkit but how do i get the angle or rotation of marker
Thank you
May 14th, 2009
Hey Mr. Kangoo… Didn’t fully read through your code but:
var patternClasses:Array = {MarkerPattern01, MarkerPattern02, MarkerPattern03};
should be
var patternClasses:Array = [MarkerPattern01, MarkerPattern02, MarkerPattern03];
{}=Your making an Object. eg. var myOb:Object={var1: value1, var2: value2};
[]=Your making an Array.
May 14th, 2009
Pravin… Read some other posts on my site and you’ll see there is a later post with how to get translation and rotation.
May 14th, 2009
Hi Mikko,
Thanks for the help I’ll give that a go. It’s not actually my code though – Eric Soco posted it earlier (above) regarding multiple trackers and I really want to play
By the way thanks for posting this tutorial I’d be lost in the dark without it.
I’m not a programer, I’m a 3d artist so your tutorial has been great for someone like me – Cheers!
May 14th, 2009
Hmmm… I’m still getting errors. Did anyone else get the multi detector going?
Here is the code I am using:
package
{
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.Event;
import flash.media.Camera;
import flash.media.Video;
import flash.utils.ByteArray;
import org.libspark.flartoolkit.utils.ArrayUtil;
import org.libspark.flartoolkit.core.FLARCode;
import org.libspark.flartoolkit.core.param.FLARParam;
import org.libspark.flartoolkit.core.raster.rgb.FLARRgbRaster_BitmapData;
import org.libspark.flartoolkit.core.transmat.FLARTransMat;
import org.libspark.flartoolkit.core.transmat.FLARTransMatResult;
import org.libspark.flartoolkit.detector.FLARMultiMarkerDetector;
import org.libspark.flartoolkit.pv3d.FLARBaseNode;
import org.libspark.flartoolkit.pv3d.FLARCamera3D;
import org.papervision3d.cameras.Camera3D;
import org.papervision3d.lights.PointLight3D;
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.objects.primitives.Cube;
import org.papervision3d.objects.primitives.Plane;
import org.papervision3d.render.LazyRenderEngine;
import org.papervision3d.scenes.Scene3D;
import org.papervision3d.view.Viewport3D;
public class Multi_Detector extends Sprite
{
[Embed(source="../lib/camera_para.dat", mimeType="application/octet-stream")]
private var CameraParameters:Class;
[Embed(source="../lib/G_Marker.pat", mimeType="application/octet-stream")]
private var MarkerPattern01:Class;
[Embed(source="../lib/A_Marker.pat", mimeType="application/octet-stream")]
private var MarkerPattern02:Class;
private var cameraParameters:FLARParam;
private var markerPatterns:Array;
private var markerPattern:FLARCode;
private var baseNodes:Array;
private var raster:FLARRgbRaster_BitmapData;
private var detector:FLARMultiMarkerDetector;
private var transMats:Array;
private var cam:Camera;
private var vid:Video;
private var capture:BitmapData;
private var cam3D:FLARCamera3D;
private var scene3D:Scene3D;
private var viewPort:Viewport3D;
private var mainContainer:FLARBaseNode;
private var renderer:LazyRenderEngine;
private var planeMat:FlatShadeMaterial;
private var numShot:uint = 0;
private var trans:FLARTransMatResult;
private var prevSet:Boolean = false;
private var prevZ:Number = 0;
public function Multi_Detector():void
{
cameraParameters = new FLARParam();
cameraParameters.loadARParam(new CameraParameters() as ByteArray);
// init patterns and multi-marker detector
var patternClasses:Array = [MarkerPattern01, MarkerPattern02];
markerPatterns = new Array(patternClasses);
for (var i:int = 0; i < patternClasses.length; i++)
{
markerPatterns[i] = new FLARCode(16, 16);
markerPattern[i].loadARPatt(new (patternClasses[i] as Class)());
}
var markerWidth:Array = new Array(40, 40);
//Get our webcam going
cam = Camera.getCamera();
cam.setMode(320, 240, 30); //30fps
//Create a new video object to show our webcam
vid = new Video();
vid.width = 640;
vid.height = 480;
//vid.x = stage.stageWidth/2-vid.width/2;
//vid.y = stage.stageHeight/2-vid.height/2;
vid.attachCamera(cam);
addChild(vid);
capture = new BitmapData(vid.width, vid.height, false, 0×0);
capture.draw(vid);
raster = new FLARRgbRaster_BitmapData(capture);
detector = new FLARMultiMarkerDetector(cameraParameters, markerPatterns, markerWidth, markerPatterns.length);
//Papervision scence
scene3D = new Scene3D();
cam3D = new FLARCamera3D(cameraParameters);
mainContainer = new FLARBaseNode();
scene3D.addChild(mainContainer);
viewPort = new Viewport3D(vid.width, vid.height);
viewPort.scaleX = viewPort.scaleY = 2;
addChild(viewPort);
renderer = new LazyRenderEngine(scene3D, cam3D, viewPort);
var light:PointLight3D = new PointLight3D();
light.x = 1000;
light.y = 1000;
light.z = -1000;
var cubeMaterialList:MaterialsList = new MaterialsList( { all: new FlatShadeMaterial(light, 0×0099FF, 0×0066AA) } );
var cube:Cube = new Cube(cubeMaterialList,30, 30, 30);
cube.z += 15;
mainContainer.addChild(cube);
//Material for our plane
var wMat:WireframeMaterial = new WireframeMaterial(0×0033FF, 1, 1);
wMat.doubleSided = true;
var plane:Plane = new Plane(wMat, 80, 80);
mainContainer.addChild(plane);
/*
* This is a Transformation matrix which Flar will
* fill and then we will use this to rotate mainContainer
*/
transMats = new Array(markerPatterns.length);
for (var j:int = 0; j < markerPatterns.length; j++)
{
transMats[j] = new FLARTransMatResult();
}
// init base nodes
baseNodes = new Array(markerPatterns.length);
for (var k:int = 0; k < markerPatterns.length; k++)
{
baseNodes[k] = new FLARBaseNode();
}
//Main loop where all the magic happens
this.addEventListener(Event.ENTER_FRAME, mainEnter);
}
private function mainEnter (e:Event) :void
{
capture.draw(vid);
var numDetectedMarkers:int = detector.detectMarkerLite(raster, 100);
var markerId:int;
for (var i:int = 0; i < numDetectedMarkers; i++)
{
// ignore detected markers with low confidence
if (detector.getConfidence(i) < 0.5) { return; }
// figure out which marker we’re looking at
markerId = detector.getARCodeIndex(i);
// set the transformation matrix accordingly
detector.getTransmationMatrix(i, transMats[markerId]);
}
// apply transformation matrices to base nodes
for (i = 0; i < baseNodes.length; i++)
{
baseNodes[i].setTransformMatrix(transMats[i]);
trace(numDetectedMarkers);
}
//Render the papervision scene
renderer.render();
}
}
}
//End
I get an error:
[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.
from this line:
markerPattern[i].loadARPatt(new (patternClasses[i] as Class)());
Any help would be great – thanks!
May 15th, 2009
Arrrrgh!!! It was just a silly typo!
It was ment to be:
markerPatterns[i].loadARPatt(new (patternClasses[i] as Class)());
instead of:
markerPattern[i].loadARPatt(new (patternClasses[i] as Class)());
Sorry to post all that code just for a stupid typo. – Doh
May 17th, 2009
(continued from above – see my previous posts)
Now I have it detecting the multiple squares but it has an error because
it can’t find the arcode_id which is in the FLARMultiDetector.as.
Error #1069: Property arcode_id not found on org.libspark.flartoolkit.detector.FLARMultiMarkerDetectorResult and there is no default value.
Fault, getARCodeIndex() at FLARMultiMarkerDetector.as:267
Has ayone else got the multi detector going or know what I’m doing wrong?
How am I ment to use the arcode_id.
May 17th, 2009
Never mind – sorted it now. Read through a previous email from Eric – Thanks Eric!
May 17th, 2009
Hey does anyone know why my frames per second is sooooo slow (2fps!).
- I’m using a fast computer.
- doesn’t make a difference at 640 x 480 or 320 x 240.
- FPS is set at 30 fps in flash properties.
- Flash quality is set to low.
- I am only using basic code from here (one marker).
- I am using basic model (cube!).
Sorry I didn’t want to bug anyone but I am running out of ideas and this is driving me nuts! Heeeelp.
May 18th, 2009
Hi,Mikkho
thanks for the reply
but
From the flar tool kit i am getting the transformation matrix with values like
-0.99 , -0.07, 0.05 , 22.87
-0.06, 0.94 , 0.32, -8.98
-0.02, 0.32 , -0.94, 282
but i am unable to understand what’s that value
& Can we calculate the actual angleOf rotation from
the transformation matrix
Thank you
May 20th, 2009
Mikkoh awesome material here man to help people get started with Augmented Reality.
I was wondering if anyone else is having problems where you seems to have the 3D image flashing around your webcam view in all sorts of random places way before you show the maker?
I have a demo going and when I hold up the marker I do get the rendered 3D image but before or after holding up the marker I get blips and flashes of the rendered image all over the screen.
Any idea what might be causing that.
I do have the normal settings I seem to be seeing everywhere else with .05.
if(detector.detectMarkerLite(raster,80)&& detector.getConfidence() > .05)
May 20th, 2009
Thanks mikko,
I got the angle
http://www.mikkoh.com/blog/?p=281
May 22nd, 2009
i have tried this with flex on a mac and the cameras param will not detect my built in isight camera. i can’t get it to work either. please reply
May 25th, 2009
I watch this guy for year, yea he do a lot of crazy stuff, but I know he is a really good and nice person. My boyfriend got his all best fights and we probably going to pray today and watch his in ring – so sad love you Mike.
May 27th, 2009
Hey great tutorial!
is there a way to make the 3d model disappear when the marker isn’t detected?
June 2nd, 2009
Hi,
I came across this tutorial while looking for information on getting the FLARToolkit to work with multiple markers.
I have a working (and a not working) example up at this page: http://www.sillypog.com/projects/ar/
The models aren’t very good but I’d be interested to hear if other people get decent results with it.
Cheers,
Pete
June 3rd, 2009
Hellooo !?I’m working with augmented reality and i want to create a plane with a movie but i have a problem. could it be possible to send you the code?
June 10th, 2009
Can this done by using flash cs4?
Must use flex builder to make it?
June 14th, 2009
very nice, but how can I change the cube for other object like a file ball.dae ?
Thanks
June 22nd, 2009
Mikkoh, this guy Chris Hughes modified your Flash AR tutorial code and presented it at TED, claiming that he made the code. See:
http://blog.ted.com/2009/06/a_note_on_today.php
http://www.unitzeroone.com/blog/2009/06/23/ideas-worth-taking-credit-for-the-ted-augmented-reality-hoax/
The code he used is available for download at his website. He does acknowledge you at all, that the code and tutorial is your work:
http://www.spazout.com/
July 2nd, 2009
It is a lot of atlking about Michael Jakcson dead, it’s a evry meotional for me because I love his music, I still didn’t believe in his dead. Hi wasw a definitey King of music
July 6th, 2009
I want to listen good music!
July 9th, 2009
I try SimpleCube from Saqoosha. But when I running the swf file, the framerates of camera in swf is too slow. Do U know why..???
July 16th, 2009
Very fun to try!
But I’ve got one question. Does anyone knows if it’s possible to display a video (flv,mov…) instead of a collada 3D model?
If yes, can you help me because I just can’t find the solution…
Thanks.
July 17th, 2009
Hey Mikko,
I’ve been playing around with your example and I think I figured out what the offset problem is (the second gotcha). I’m not sure if anyone else figured it out and posted in the comments … I didnt go through all the comments since there are too many. Anyway the problem is with reading the bitmap data from the vid object. This line in the Main.as :
capture.draw(vid);
I outputted the actual bitmap data on screen and here’s what I got http://maxtherocket.com/media/bitmap_data.jpg
It seems that even though the code is telling the webcam to use 640×480 resolution with cam.setMode(640, 480, 30); the webcam still outputs only 320×240. The vid object listens and displays the 320×240 as 640×280 and thats what we see on screen. But when we grab the bitmap data off the vid object using the draw method it gives us only the 320×240 video on the top-left corner and the rest of the area is just black. Now I’m not sure if every webcam does this or not but since you seem to have the problem I’m guessing a lot of consumer webcams do this .. somebody please correct me if I’m wrong. So since we are giving the FLAR toolkit this bitmap where the video still is only 320×240 with the rest of the bitmap being black FLAR toolkit just wastes resources trying to find the marker in all that empty black space. Also when it finds the marker in the tiny 320×240 video frame it thinks that the marker is small (which reduces the toolkit’s precision drastically) and that it’s positioned in the top-left corner thus giving us false 3d transformation coordinates.
HERE’S THE FIX:
Instead of getting the bitmap data straight from the vid object put the vid object in another sprite, I called it vidHolder, the just capture the bitmap data of the vidHolder. Now we get a nice, large 640×480 video frame for FLAR toolkit to do its calculations on, just the way it expects it
July 27th, 2009
Hey max…
Yes I noticed this also however. I noticed that it was because I was constructing the Video object with no width and height parameter.
Flash will create a video object that is actually 320×240 and then after that if you try to draw it, it will be 320×240.
If you just pass in the correct width and height there is no need to place the video instance inside a container.
July 27th, 2009
You’re right, I didn’t notice that the constructor sets 320×240 by default, thanks. I still see a bit of an offset, a few pixels really. Were you able to fix this? I’m gonna give FLAR Manager a try.
July 28th, 2009
Hii
I read the whole comments, but unfortunatelly I hadn’t found same problem that I have.
I can’t run the actionscript becouse it is writing error 1046: The type was not found….. and it also couldn’t found the “flash.display.Sprite”
Please someone help me how can I solve the problem
Thanks in advance
Tamerygo
August 11th, 2009
Hi there,
Would you have any idea on how to capture the webcam and Augmented reality together and save it to a FMS? When i use the publish option on a netstream it only captures and saves the webcam object, not the augmented reality as well?
if you have any insight as to how to achieve this it would be much appreciated!
August 17th, 2009
the site for ARtoolkit is not loading at my end
September 1st, 2009
Hi Mikkoh!
Thank you.
You are one of the people that understand AR and have a lot of pingbacks and in many webpages in my bookmarks ther is the link for this post, so, I have decided ask you something. I have a animation in 3DsMax, and COLLADA give me the posibility to export the animation in the dae file, so, I mark this options and export my file. But, I don’t know how to say to Papervision3D that show the animation, pv3d show me only the 3D element, but not the animation. I really appreciate your response Mikkoh
September 2nd, 2009
Need basic instruction as to how to take the MyOenObject.as file exported from Blender (via the export script mentioned above) and use it to replace the cube code in the example main.as file. Thanks!
Also – it looks like the Papervision included in the example file was a beta 2. Is it easy to update it with the latest version?
September 5th, 2009
Hello, pretty good this Augmented Reality.
I’m trying to study your example.
I’m trying to show only 1 image . jpg or. swf, without 3D, I tried to use a load, but I could not show de image.
Is possible show only 1 image?
Is very complicated to modify the code?
September 9th, 2009
Here is a simple piece I did to begin exploring FLARToolkit with anaglyph glasses.
http://secd.unl.edu/~mbentz/flart_example/SimpleCube.html
September 17th, 2009
September 23rd, 2009
??? ??? ???????, ?? ????? ???????? ??? ? ????????? ????.
September 26th, 2009
??????? ????? ????? ?? ?????????…
September 26th, 2009
???????? ??????, ??????, ?????????, ?????? ? ?????? ???????? ?????!
September 26th, 2009
Hey Mikkoh,
thank you very much for your blog, it helped me to test the augmented reality!!! I did it today, I just load another model wich I exported from 3dsmax to dae using this plugin:
http://sourceforge.net/projects/colladamaya/files/
But my model is in auto illumination 100%, do you know why I got this? it looks like this:
http://users.skynet.be/fc440959/screener.jpg
I am thinking if we can have directX/openGL shadowz with out lightbaking on papervision?
Thx again Mikkoh!! as I said before, cause I tried first with another website, wich waz a bit difficult for me, with yours I got something quicly (I am a graphic designer more than a develloper), here is some 3d that I realised before:
http://users.skynet.be/fc440959/showroom3d.htm
http://jeremybelly.cgsociety.org/gallery/
see you
October 12th, 2009
Hi
sorry its me again, I think I have to set my scene with something like this:
http://www.madvertices.com/2008/10/papervision-3d-phongmaterial.html
wow its going to be hard for me : )
October 12th, 2009
Hi Mikkoh!
Hope you can help me, I’ve been looking all over the web how to make a simple preloader for my DAE files, i’m new to AS3 so im starting to understand how preload now works.
For now i have tried the following with no results:
collada3DModel = new DAE();
collada3DModel.addEventListener(ProgressEvent.PROGRESS, loading);
collada3DModel.addEventListener(Event.COMPLETE, loaded);
collada3DModel.load(“logo.dae”);
functions…
Hope you can help me!
October 13th, 2009
Hi Mikkoh,
Here is a few snapshots from my last augmented reality test, I imported a textured model on which I baked a global illumination lighting system from 3dsmax, cause I need to learned how to light a model directly in papervision (it’s hard for me, I need to spend more time on my PC to do it correctly…):
http://users.skynet.be/fc440959/shot1.jpg
http://users.skynet.be/fc440959/shot2.jpg
http://users.skynet.be/fc440959/shot3.jpg
http://users.skynet.be/fc440959/shot4.jpg
Ok Mikkoh thx again to show me the way on your blog, lets keep in touch!
October 14th, 2009
Hey there,
I am trying to debug and issue with compiling this in Flash CS3 using FLARTool and Papervision3D.
The camera is preparing properly, and the marker is being processed and returned properly ( i am notified via a trace that the Marker is recognized)
However, when i go to render the collada3DModel is get the following error
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at org.papervision3d.core.math::Matrix3D/calculateMultiply4×4()
at org.libspark.flartoolkit.support.pv3d::FLARCamera3D/transformView()
at org.papervision3d.core.render.project::BasicProjectionPipeline/project()
at org.papervision3d.render::BasicRenderEngine/renderScene()
at org.papervision3d.render::LazyRenderEngine/render()
at AugmentedReality/preparePaperVision3D()
at AugmentedReality()
It doesnt matter what i use for a model, i get the same error?
THoughts?
October 15th, 2009
Nice model… What kind of FPS are you getting Jeremy?
October 17th, 2009
Very nice, I got mine up and running. My Prof will love this
November 16th, 2009
Hey Everyone,
Firstly, thank you very much for the blog mikkoh. Your help is greatly appreciated. Secondly, I tried getting this bad boy to work for a week in Flash. I found the best thing to do was to use Saqoosha’s startup guide as a template then change the P3D accordingly…
http://saqoosha.net/en/flartoolkit/start-up-guide/
So for all using Flash, check it out. I’m not a great coder and I got it to work this way. I hope I’m not humiliating myself.
Cheers!
November 30th, 2009
Hey fellows,
The link http://www.libspark.org/svn/as3/FLARToolKit/trunk isn’t working. When I use SVN to download it it gives errors. Is it moved somewhere else??
Thanks a lot!
December 7th, 2009
Hey Mikko,
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!!
December 9th, 2009
Hi there,
Everything is good exept one error:
1046: Type was not found or was not a compile-time constant: Event. line 116
How is that possible? Is there something that I don’t have? ( the event listener ). I triedimport flash.events.Event; but after that I get more errors. Who can help me.
Thanks,
Martijn
December 24th, 2009
Hello everyone!!!
I’m trying to create my own patter file using ARToolKit Marker Generator! And I face a problem that if I want to create a pattern that differs from the black square with some symbols inside – that software does not recognise it as a pattern at all!!!!
Anybody knows is there any way to make a custom pattern manualy? As I see – I can not edit pattern file using my photoshop or other graphic program
I think it will be very cool if, for example to create a pattern that recognises a drivers license! Or maybe its impossible?
Thanx in advance for any suggestions!
January 13th, 2010
Fantastic article, will def share the link around
January 15th, 2010
This is useful article. Thanks so much.
January 18th, 2010
What a fantastic read, thank you for this.
January 18th, 2010
Hi, everyone..
i’m newbiee in AR, i have a question, can i capture logo company as pattern in AR ?
thanks for everyone…
February 9th, 2010
What other types of 3d files can you use with this?
February 12th, 2010
I am new at AR
I followed your instructions but i keep getting this error
1017: the definition of base class NyARCode was not found
resource: FLARCode.as
February 15th, 2010
I try to compile with Flex.so it report no error and popup a flash window but nothing appear on the windows. I dont know what should i do. please tell me..
package {
import flash.display.Sprite;
import flash.media.Camera;
import flash.media.Video;
import flash.utils.ByteArray;
import org.libspark.flartoolkit.core.FLARCode;
import org.libspark.flartoolkit.core.param.FLARParam;
[SWF(width="640".height="480".frameRate="30".backgroundColor="#FFFFFF")]
public class FLARProject extends Sprite
{
[Embed(Source ="\pat_Marker.pat", mimeType ="application/octet-stream")]
private var pattern:Class;
[Embed(source ="\camera_para.dat", mimeType ="application/octet-stream")]
private var params:Class;
private var fparams:FLARParam;
private var mpattern:FLARCode;
private var vid:Video;
private var cam:Camera;
public function FLARProject()
{
setupFLAR();
setupCamera();
}
private function setupFLAR():void
{
fparams = new FLARParam();
fparams.loadARParam(new params() as ByteArray);
mpattern = new FLARCore(16, 16);
mpattern.loadARPatt(new pattern());
}
private function setupCamera():void
{
vid=new Video(640, 480);
cam=Camera.getCamera();
cam.setMode(640, 480, 30);
vid.attachCamera(cam);
addChild(vid);
}
}
}
February 23rd, 2010
hello I have a problem from the beginig…je,je,je mmmm, I am a beginer in flash I know tha basics of action script 2, and I have a problem I cant solve, in the svn (I´m a mac user) i get this error:
svn: This client is too old to work with. You need
to get a newer Subversion client, or to downgrade this working copy.
See http://subversion.tigris.org/faq.html#working-copy-format-change
for details.
-Then i go there and they tell me this:
For this reason, we distribute a script that can downgrade working copies when doing so is safe:
http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/change-svn-wc-format.py
Run that script with the “–help” option to see how to use it. As future versions of Subversion are released, we will try to keep this FAQ entry up-to-date with potential downgrade scenarios and their implications.
AND I CANT UDERSTAD WAHT DO I HAVE TODO, WHERE I PUT THE SCRIPT??? I JUST DONT GET ANYTHING!!!
PLEASE CAN U HELP ME???
THANK YOU
February 25th, 2010
hi, i’m totaly new in AR, i’m starting with this flartoolkit start kit, I use pretty well AS3, but I’ve just started FLEX.
how can i recompilate a project in flex? for now, I just can change the pattern to mine and the DAE too.
thanks for answering
February 26th, 2010
hello I have a problem from the beginig…je,je,je mmmm, I am a beginer in flash I know tha basics of action script 2, and I have a problem I cant solve, in the svn (I´m a mac user) i get this error: cars sale I try to compile with Flex.so it report no error and popup a flash window but nothing appear on the windows. I dont know what should i do. please tell me..
May 10th, 2010
Bonjour,
j’ai réalisé une Intelligence Artificielle qui possède la synthèse vocale en CS3 AS3.
Je cherche de l’aide pour réaliser une réalité augmentée.
http://jennybot.discutforum.com
merci beaucoup
May 11th, 2010
@ KONGKIAT HIRANKERD
Im not sure at all, but i already have same kind of errors ( no compilation error msg and no execution error msg, blank window ) :
-when files ( pictures, or .pat ) are not in good relative directory.
-when… i did not allow webcam for flash XD
sorry for my stupid answers XD and my poor english i hope its just this problem, good luck !
May 11th, 2010
I trying to create a pattern (.pat) file that works. I’ve created a graphic per the above instructions (80×80 cm, with a 40 x 40cm white area within), printed it would, and captured it using MakerGenerator.air. Now the file that is created has a wide range of values in it when I open it with Notepad, whereas in all the example .pat files I have the values are either 0 or 255. As it’s going to be searching for threshold values based on the .pat file, 0 and 255 make alot of sense, and in-between values don’t. So why is MakerGenerator.air creating a marker file with these values?
As far as getting it to work, I’m working with FLARManager’s code, which uses an xml file to specify the .pat files to use. So I’ve added my .pat file into that document, and that, I presume, will add my custom pattern to be searched for. I’ve added my .pat file into the same location as the example files.
But my pattern is not detected, and the example patterns are. I’m uncertain as to what the problem is – a .pat file that has the wrong values, or am I missing something else?
May 25th, 2010
http://10threality.weebly.com/index.html
this website has free codes and download links for Adobe Flex
check it out
June 5th, 2010
thanks you
July 12th, 2010
Reply to “FlarToolkit/Flash Augmented Reality
Getting Started”