Author Topic: Shader3D & Animations  (Read 147 times)

nero king   «   on: May 14, 2012, 01:07:48 AM »
i want setMaterial for a Pivot3D, that Pivot3D have animations.
but I found , that Pivot3D's animation can't Play().

------------------------------------------------------------------------------------------

public function Test24_AppendAnimations() {
    scene = new Viewer3D(this);
    scene.addEventListener( Scene3D.COMPLETE_EVENT, completeEvent );
         
    char = scene.addChildFromFile( "../resources/anim_base.f3d" );

    anim1 = new Flare3DLoader( "../resources/anim_base1.f3d" );
    anim2 = new Flare3DLoader( "../resources/anim_base2.f3d" );
    scene.library.push( anim1 as Flare3DLoader );
    scene.library.push( anim2 as Flare3DLoader );
}

private function completeEvent(e:Event):void {

    Pivot3DUtils.appendAnimation( char, anim1, "anim1" );
    Pivot3DUtils.appendAnimation( char, anim2, "anim2" );
         
    var shader:Shader3D = new Shader3D("",[new ColorFilter(0xff9900)]);
    shader.build();
    char.setMaterial(shader);
         
    char.play(); // ------------------------- can't play();
         
}

Ivan Vodopiviz   «   Reply #1 on: May 14, 2012, 03:54:39 PM »
Hi,

You have to set up your material for animation, something like this:

var shader:Shader3D = new Shader3D( "", [new ColorFilter(0xff9900)], true, Shader3D.VERTEX_SKIN );

Hope this helps,

nero king   «   Reply #2 on: May 14, 2012, 11:27:00 PM »
thank you very much~~