

package
{
import flash.events.Event;
import org.papervision3d.events.FileLoadEvent;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.special.DAEMC2;
import org.papervision3d.view.BasicView;
public class daemc_main extends BasicView
{
var model:DAEMC2;
public function daemc_main ()
{
model = new DAEMC2(false,null,0);
//var material:BitmapFileMaterial = new BitmapFileMaterial("grey_checker.jpg",true);
// material.doubleSided = true;
//model.load ("robot.dae", new MaterialsList ( { lambert2:material } ));
model.load ("robot.dae");
model.scale = 60;
model.addEventListener (FileLoadEvent.ANIMATIONS_COMPLETE, addit2Stage);
model.yaw(180);
startRendering ();
}
private function addit2Stage (e:FileLoadEvent):void
{
trace(model.totalFrames);
scene.addChild (model);
model.currentFrameNumber = 1;
model.play ();
//model.inReverse = true;
//model.addFrameScript (10, toDo);
}
override protected function onRenderTick(event:Event = null):void
{
super.onRenderTick(event);
model.yaw(0.1);
}
private function toDo ():void
{
model.stop();
trace (model.currentFrameNumber);
}
}
}
4 Comments:
It's cool charactor demo.
Glad I found your blog. I'm doing practically the same thing, but I'm having trouble getting the dae export to see all of my frames of animations.
Are there any particular settings you ticked that made this work? I have about 600 frames of animation, but it only finds 8 at runtime.
Thanks for the help!
I got it working for the most part.
I looked at your dae file and the two settings I changed were:
-checked bake transforms
-unchecked relative paths
-checked export constraints
I was getting animation before, but only a fraction of a second of it. Thanks.
Good, you find the way to complete your task now.
enjoy it !! :)
Post a Comment