This project is read-only.

Hi,How to use the SkinnedActor?

May 21, 2013 at 3:58 AM
hi , i load the model , but the bone play animation is right but the geometry is static.

i look the old thread , ..

i got the model ,dwarf2 , and modify the skinandbones_desktop project.

now code :
    //m_pStaticActor = new Actor();
    m_pStaticActorSkinned = new SkinnedActor();
    GeometryPtr pStaticGeometry = GeometryLoaderDX11::loadMS3DFileWithAnimation( std::wstring( L"dwarf2.ms3d" ),m_pStaticActorSkinned);
    //GeometryGeneratorDX11::GenerateWeightedSkinnedCone( pStaticGeometry, 16, 20, 2.0f, 40.0f, 6, m_pStaticActorSkinned );
    MaterialPtr pStaticMaterial = MaterialGeneratorDX11::GenerateStaticTextured( *m_pRenderer11 );

    m_pStaticActorSkinned->GetBody()->SetGeometry( pStaticGeometry );
    m_pStaticActorSkinned->GetBody()->SetMaterial( pStaticMaterial );
    //m_pStaticActorSkinned->GetBody()->SetMaterial( pStaticMaterial );

//  RotationController* pRotController3 = new RotationController();
//  m_pStaticActor->GetBody()->AttachController( pRotController3);

    ResourcePtr ColorTexture = RendererDX11::Get()->LoadTexture( L"dwarf2.jpg" );
    ShaderResourceParameterWriterDX11* pTextureParameter = new ShaderResourceParameterWriterDX11();
    m_pStaticActorSkinned->GetBody()->Parameters.SetShaderResourceParameter( L"ColorTexture", ColorTexture );

    // Attach the actors to the scene, so that they will be rendered all together.

    //m_pScene->AddActor( m_pDisplacedActor );
    //m_pScene->AddActor( m_pSkinnedActor );
    m_pScene->AddActor( m_pStaticActorSkinned );

    // Setup the skinned actors' bind poses and start their animations.

    m_pDisplacedActor->SetSkinningMatrices( *m_pRenderer11 );

    m_pSkinnedActor->SetSkinningMatrices( *m_pRenderer11 );

    m_pStaticActorSkinned->SetSkinningMatrices( *m_pRenderer11 );

    m_pStaticActorSkinned->GetNode()->Position() = Vector3f( 0.0f, 0.0f, 0.0f );
    //m_pStaticActorSkinned->GetNode()->Scale() = Vector3f(10.0f,10.0f,10.0f);

    m_pSkinnedActor->GetNode()->Position() = Vector3f( 0.0f, 0.0f, 20.0f );
    m_pDisplacedActor->GetNode()->Position() = Vector3f( 20.0f, 0.0f, 20.0f );
please help and teach me how to use skinnedactor load custom model and animation.

thanks .

May 21, 2013 at 12:03 PM
Hello Garfield,

That loader method was never quite working properly. MS3D does something strange with their bone rotations that I wasn't able to figure out before. This is why the skin and bones demo uses a procedurally generated bone mesh...

Even so, I can take a closer look at your code later today and see if anything jumps out at me as pointing to the issue. Do you have a copy of the dwarf model available somewhere online?
May 23, 2013 at 4:05 AM
thank you for you reply and the model download url :


e ... will Hieroglyph-Engine use another model format ?


thanks .