View Collada Spongebob in Papervision
I had some time on my hands this weekend and decided to mess around with loading Collada models with Papervision. I snagged a few models from Google Sketchup and went to town. Also tried to work in some OOP instead of just having one huge papervision file. I really need to clean up the source but rest assured the full source will be posted soon.
Basic lesson is that you can load a Collada file with just actionscript (packaged as a zip or just the dae file)
-
//Load zipped dae file
-
protected function loadKMZ():void
-
{
-
kmz = new KMZ();
-
kmz.load("model/spongebob_squarepants.zip");
-
kmz.addEventListener(FileLoadEvent.LOAD_ERROR, onKmzError);
-
kmz.addEventListener(FileLoadEvent.LOAD_COMPLETE, onKmzLoaded);
-
-
//Scale if needed
-
kmz.scale = 20;
-
container.addChild(kmz);
-
}
-
-
//load the dae file
-
protected function loadDAE():void
-
{
-
dae = new DAE();
-
dae.load("model/spongebob_squarepants.dae");
-
dae.addEventListener(FileLoadEvent.LOAD_ERROR, onDaeError);
-
dae.addEventListener(FileLoadEvent.LOAD_COMPLETE, onDaeLoaded);
-
container.addChild(dae);
-
}



Recent Comments