DAE deformed with bonesAnimator

Software: Away3D 3.x

Avatar
Austen, Newbie
Posted: 01 August 2011 12:05 AM   Total Posts: 21

This is my first thread in this forum, so…
Hello world smile

I used to develop with papervision, but recently swapped to away3d.
(3.6.0, flash CS4, player 10.3.181.34)

I am currently adapting the code of a small project for away3d, but I got mysterious issues with… bonesAnimator.

I bought the cookbook and the friendsofEd’s book, but i’m still answer-less. Nowhere on the Internet is clearly talking about that :

My .DAE is fine when static, but when i do :

bonesAnimator.play(); 

All is screwed up. The mesh goes 10 miles away and is scarily deformed.

I tried with the running mario, he’s screwed up too.
I copy/pasted the 2 books codes… my meshes are still deformed.
I spent 3 days trying to get the point, I edited my colladas with notepad, I tried everything, I am goodwilling, but away3d keeps rejecting me.

And I don’t know why.

Here’s my test code :

import away3d.animators.*;
import away3d.cameras.*;
import away3d.containers.*;
import away3d.core.utils.*;
import away3d.events.*;
import away3d.loaders.*;
import away3d.materials.*;

import flash.display.*;
import flash.events.*;
import flash.utils.*;

//engine variables
var camera:Camera3D;
var 
view:View3D;
var 
scene:Scene3D;

//objectvariables
var collada:Collada;
var 
loader:Loader3D;
var 
model1:ObjectContainer3D;

//animation varibles
var bonesAnimator:BonesAnimator;
var 
loaded:Boolean;


initEngine();
initObjects();
addEventListener(Event.ENTER_FRAMEmonEnterFrame);
stage.addEventListener(KeyboardEvent.KEY_DOWNmyKeyDown);


function 
initEngine():void
{
 scene 
= new Scene3D();
 
camera = new Camera3D();
 
 
view = new View3D();
 
view.camera camera;
 
view.scene scene;
 
 
addChild(view);
}


function initObjects():void
{
 
//loader = Collada.load("assets/mario_testrun.dae", {scaling:10, material:material, mouseEnabled:false}) as Loader3D;
 
collada = new Collada();
 
loader = new Loader3D();
 
loader.loadGeometry("assets/anim_03.dae"collada);
 
loader.addEventListener(Loader3DEvent.LOAD_SUCCESSonSuccess);
 
scene.addChild(loader);
}


function monEnterFrame(event:Event):void
{
 
//render scene
 
view.render();
 if(
loaded)
 
{
  
//bonesAnimator.update(getTimer()*2/1000);
 
}
}

function myKeyDown(e:KeyboardEvent):void
{
 
switch (e.keyCode{
  
case 90:
   
camera.zoom += 0.2;
   break;
  case 
83:
   
camera.zoom -= 0.2;
   break;
  case 
68:
   
bonesAnimator.play();
   break;
  case 
81:
   
bonesAnimator.stop();
   break;
 
}
 trace
("zoom "+camera.zoom);
}


function onSuccess(event:Loader3DEvent):void
{
 loaded 
true;
 
 
model1 loader.handle as ObjectContainer3D;
 
model1.scale(10);
 
model1.+= 30;
 
model1.-= 20;
 var 
colorMaterial:ColorMaterial = new ColorMaterial();
 
colorMaterial.color 0xFFA500;
 
model1.material colorMaterial;
 
scene.addChild(model1);
 
trace(model1);
 
bonesAnimator model1.animationLibrary.getAnimation("default").animator as BonesAnimator;
 
bonesAnimator.loop true;
 
//bonesAnimator.play();
   

ge5, Newbie
Posted: 01 August 2011 07:59 PM   Total Posts: 13   [ # 1 ]

yes—i am having the same frustrations moving from animating with collada + PV3D and trying to follow through with away3D 3.6! Models load in fine as static and seem to get crazy with motion (though i am trying bone animation through code)...it seems like this engine gives nominal support to collada? (if you see the responses to posts i’ve made recently)—please let me know if you discover anything! best, G.E.

   

Avatar
Austen, Newbie
Posted: 02 August 2011 02:37 PM   Total Posts: 21   [ # 2 ]

hi ge5,

i partly solved the issue by downloading flash player 11.
my .dae animation is fine, but the fact you need flash 11 to see it well is problematic… only flash 11 people will be able to launch my app.

i can work on my code though, but if anybody has a solution to make it work on flash 10.3, it would be awesome…

try downloading flash 11 smile

   

ge5, Newbie
Posted: 02 August 2011 09:45 PM   Total Posts: 13   [ # 3 ]

thanks for yr response—i am using a Mac, OS10.6, and after numerous attempts at installing FP 11 it contimues to crash safari. any suggestions? and are you still using away3d 3.6? or isn’t 4.0 for flash player 11? thx.

   

Avatar
Austen, Newbie
Posted: 05 August 2011 03:29 PM   Total Posts: 21   [ # 4 ]

I am still using away 3.6 (using windows7) ;

I am testing my app by pressing f12 in the .fla, to see it directly in firefox.
I just tried in safari, and it works well for me.
Did you try with another navigator?

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X