Weird result using Skeleton

Software: Away3D 4.x

CbbK, Newbie
Posted: 20 April 2013 07:18 PM   Total Posts: 13

Hi,
I’m writing because I have a strange behaviour with Away3D 4.1 Alpha, when using Skeleton.
My purpose with this animation is very simple, it’s just to have an animated character moving over a plane. I can have the character moving as I want, but the problem is that the plane is moving as well! The plane was added as a child of the scene, the animated mesh is a child of a class “Character”, itself child of the scene :

public class Character extends ObjectContainer3D {
  
... vars ...
  public function 
Character() {
   _assetBundle 
AssetLibrary.getBundle("character");
   
_stateTransition = new CrossfadeTransition(0.5);
   if (!
_assetBundle.getAsset("mesh")) {
    _assetBundle
.addEventListener(AssetEvent.ASSET_COMPLETEon_assetComplete);
    
//load the resource if it's not available
    
_assetBundle.load(new URLRequest("3Dobj/character.md5mesh"));
   
}
   
   _state 
0;
   
visible false;
   
name "PlayerCharacter";
  
}

  
private function on_assetComplete(e:AssetEvent):void {
   trace
("AssetComplete:"e.asset.assetTypee.asset.namee.asset.assetNamespace);
   switch(
e.asset.assetType{
    
case AssetType.ANIMATION_NODE:
     var 
clipNode:SkeletonClipNode e.asset as SkeletonClipNode;
     
clipNode.name clipNode.assetNamespace;
     
_animationSet.addAnimationclipNode ); 
     
//idle by default
     
if (clipNode.name == IDLE_ANIM{
      _animator
.play(IDLE_ANIM_stateTransition);
      
visible true;
     
}
     
break;
     
    case 
AssetType.ANIMATION_SET:
     
_animationSet e.asset as SkeletonAnimationSet;
     
_animator = new SkeletonAnimator(_animationSet_skeleton);
     
_assetBundle.load(new URLRequest("3Dobj/walk.md5anim"), nullWALK_ANIM);
     
_assetBundle.load(new URLRequest("3Dobj/idle.md5anim"), nullIDLE_ANIM);
     
_mesh.animator _animator;
     break;
     
    case 
AssetType.SKELETON:
     
_skeleton e.asset as Skeleton;
     break;
     
    case 
AssetType.MESH:
     
_mesh e.asset as Mesh;
     
addChild(_mesh);
     break;
   
}
  }
}

The scene setup 
:
var 
scene:Scene3D = new Scene3D();
var 
camera:Camera3D = new Camera3D(new PerspectiveLens(26.609));
camera.position = new Vector3D(100100100);
camera.lookAt(new Vector3D(000));
var 
view:View3D = new View3D(scenecamera);
view.backgroundColor 0x123456;
view.width 640;
view.height 480;
viewContainer.addChild(view);

Loader3D.enableParser(MD5MeshParser);
Loader3D.enableParser(MD5AnimParser);
var 
character:Character = new Character();
scene.addChild(character);

var 
ground:Mesh = new Mesh(new PlaneGeometry(100100));
scene.addChild(ground); 

I attached a picture where you can see the scene without animation (_mesh.animator = _animator; commented), and with animation. As you’ll notice, the model and the plane are rotated (they should not!), and both are animated (only the character should be)! :/

I also attached my exported model and animation, perhaps there’s something wrong with them. Do you have any clue on what is going on? Thank you for your help.

 

File Attachments
3Dobj.zip  (File Size: 60KB - Downloads: 127)
   

CbbK, Newbie
Posted: 21 April 2013 10:39 AM   Total Posts: 13   [ # 1 ]

Hey, I resolved my problem by giving a material to the ground plane, it’s still very strange (or at least I couldn’t find any mention of such behaviour in the documentation), or is it normal that 2 meshes that share the same (?) material also share the same animator?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X