I embed model and animation in swf, but when play the animation.
The model looks like be distorted.
embed:
[Embed(source = '../embeds/hellknight/hellknight.md5mesh', mimeType = 'application/octet-stream')]
private var monsterModel:Class
[Embed(source = '../embeds/hellknight/idle2.md5anim', mimeType = 'application/octet-stream')]
private var monsterIdleAnim:Class
[Embed(source='../embeds/hellknight/walk7.md5anim', mimeType='application/octet-stream')]
private var monsterWalkAnim:Class
parse data:
AssetLibrary.loadData(monsterModel, null, "monsterModel", new MD5MeshParser());
AssetLibrary.loadData(idleAnim, null, "idle", new MD5AnimParser());
AssetLibrary.loadData(walkAnim, null, "walk", new MD5AnimParser());
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, onAnimationComplete)
play: I added the monster’s mesh into a objectContainer3D object.
var monster:Human = new Human();
monster.model = _modelManager.getModel("monster").clone() as ObjectContainer3D;
monster.model.position = new Vector3D(0, 150, 0);
monster.animationControler = new SmoothSkeletonAnimator(SkeletonAnimationState((monster.model.getChildAt(0) as Mesh).animationState));
monster.animationControler.updateRootPosition = false;
monster.animationControler.addSequence(_modelManager.getAnimation("monsterIdle") as SkeletonAnimationSequence);
monster.animationControler.addSequence(_modelManager.getAnimation("monsterWalk") as SkeletonAnimationSequence);
monster.animationControler.play("monsterWalk");
_view.scene.addChild(monster.model);
It worked very well in example, but not in my project.
Thanks!