I have been playing with Augmented Reality recently (and having lots of fun with it too!!) I have been able to create PaperVision primitives (cube, cylinder, cone, etc.. and work with them) But adding a DAE model is proving to be illusive!
var cubeMaterialList:MaterialsList = new MaterialsList( { all: new FlatShadeMaterial(light, 0x0099FF, 0x0066AA) } );
var cube:Cube = new Cube(cubeMaterialList,
30,
30,
30);
cube.z += 15;
mainContainer.addChild(cube);
This all works fine!
I am using this to import/attempt to import a dae!
private var mCollada:Collada;
private var universe:DisplayObject3D;
mCollada = new Collada("sample.dae");
universe = new DisplayObject3D();
universe.addChild(mCollada);
mainContainer.addChild(universe);
I have used this method of importing DAEs into a non-Augmented Reality PaperVision projects and it works a treat! So just wondering if anyone had any luck at importing DAEs with AR!
Best Answer
Click here to view a video of the necessary imports and working demo on my site.
I notice that you are using the Collada Class, as opposed to the DAE, class, which both act a bit differently as is displayed in the video abobe.
It is also important to note that you may very well be doing this correctly and that there is a problem with the model or possibly even the texture. If the texture isn't loading you should know immediately from the console. Try creating a ColorMaterial and create a MaterialsList object setting the "all" property to the ColorMaterial you created. Finally pass the list to the instantiation of Collada or DAE Classes through the instantiation or load method. Also make sure that the camera isn't zoomed in to close, possibly leaving the 3D Object behind it. Finally play with the scale, not all models come in at the same scale, and using Collada class, as opposed to DAE, seems to blow the model up considerable as shown in the video link above.
I have had a lot of time to play with the FlarToolkit / Papervision3D / Collada partnership lately in preparations for the Tony Hawk XI website.
-What you need
-Finding and prepping the model
- Importing / parsing the model and displaying it
}
Hopefully all this helps you, I suggest you just keep playing with it and keep familiarizing yourself with it.