XNA Creators Club Online
Page 1 of 2 (36 items) 1 2 Next >
Sort Posts: Previous Next

NEW Animation Library

Last post 4/5/2009 7:21 PM by WILEz. 35 replies.
  • 5/25/2008 11:38 PM

    NEW Animation Library

    XNAnimation is a skeletal animation library for the XNA, which allows developers to easly manipulate, playback, interpolate and blend skeletal animations.

    The XNAnimation 0.3 was released with source code, documentation and samples on CodePlex:
    http://www.codeplex.com/xnanimation/

    Some features of this version include:
    - Supports Windows and Xbox platforms.
    - Plays animations forward and backward, constrols animation speed and looping.
    - Supports linear, cubic and spherical keyframe interpolation.
    - Supports cross fade blending between animation clips.

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 5/26/2008 9:13 AM In reply to

    Re: NEW Animation Library

    Cool.

    By the way, your link is broken. Codedeplex is not a website... :)

  • 5/26/2008 3:00 PM In reply to

    Re: NEW Animation Library

    Ops... I correct the link now, thanks! =D
    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 5/26/2008 7:44 PM In reply to

    Re: NEW Animation Library

    So, say I didn't want to use your shader because I already have a lighting system or something. From what I can tell, SkinnedModelEffect inherits from Effect, so I could just set each SkinnedModelEffect in each ModelMesh of the model to a custom Effect. Of course, I don't know what is in the HLSL file that you used to do the skinning. Any chance we could have a look at it?
  • 5/26/2008 8:33 PM In reply to

    Re: NEW Animation Library

    The SkinnedModel is still using the XNA Model class internally, so you could just change its effect as you said:

     

    reach (ModelMesh modelMesh in skinnedModel.Model.Meshes) { 
        foreach (ModelMeshPart meshPart in modelMesh.MeshParts) { 
            meshPart.Effect = YourEffect; 
        } 

     The unique input that you need to have in your effect is a uniform matrix array, which will store the bone matrices used to deform the mesh. Then, in the vertex shader you must use it to deform your mesh. Something like this:
     

    // Uniform matrix array is stored at matBones 
     
    // Calculate the final bone transformation matrix 
    float4x4 matTransform = matBones[IN.boneIndex.x] * IN.boneWeight.x; 
    matTransform += matBones[IN.boneIndex.y] * IN.boneWeight.y; 
    matTransform += matBones[IN.boneIndex.z] * IN.boneWeight.z; 
    matTransform += matBones[IN.boneIndex.w] * IN.boneWeight.w; 
     
    // Combine with world transformation 
    matTransform = mul(matTransform, matWorld); 
    // Transform mesh's vertex and normal 
    float4 position = mul(IN.position, matTransform); 
    float3 normal = mul(IN.normal, matTransform);  

     

    At CodePlex you can find all the source code for the XNAnimation, which includes the source code of its effect. The direct link for the SkinnedModelEffect.fx is:
    http://www.codeplex.com/xnanimation/SourceControl/FileView.aspx?itemId=149383&changeSetId=6802
    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 5/26/2008 10:27 PM In reply to

    Re: NEW Animation Library

    That's helpful, thanks. I hadn't thought to check the source code tab for the source code...
  • 7/3/2008 9:30 PM In reply to

    Re: NEW Animation Library

    I must admit I am impressed with the latest release. Is there a chance you can supply source that will compile on the Xbox? I run into all sort of weirdness when i try to recompile for the xbox. (I tend to add extra geometry information to the model tag, but on the 360 I'm hitting all sorts of compilation errors - Windows compilation is fine!)
  • 7/3/2008 10:32 PM In reply to

    Re: NEW Animation Library

    I removed the Xbox projects from the source code because I was having problems to maintain it and thought it could be easily generated from the Windows projects. But in the 0.3 release I had a lot of problems trying to compile a Xbox version too.

    I will release a beta 2 version before the final version fixing some problems reported and will also try to document how to create and compile a Xbox project. I do not have a Creator's Club subscription anymore so I will try to use the trial one from DBP.  Thanks for reporting this problem.

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 7/4/2008 8:26 PM In reply to

    Re: NEW Animation Library

    Not at all - your 0.7.0.0 release was very cool - and I'm enjoying using it on Windows. I'm looking forward to your (possibly) adding directional lighting too :> (My current focus is trying to work out adding shadows from the animated models onto my terrains/water effects) but I will be happy if I can get an xbox compile - I'd love to enter the DBP!
  • 7/4/2008 10:59 PM In reply to

    Re: NEW Animation Library

    You will probably see Xbox support next week. About the effects, the idea of the library is provide a basic effect class with some common needed resources. But you change it for any other custom effect that you want. You can also modify the library shader (found on the source code) in any way you want.

     Besides of that Bryan from the "Ox Game Engine" is using the XNAnimation and he seens to have already implemented nice shadow support. Check the Ox Game Engine at CodePlex.

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 7/5/2008 4:37 PM In reply to

    Re: NEW Animation Library

    Fantastic Bruno! Your is the must simply and power library for animation!
    ...you speak italian?:)

    I've a question about your animation library and the exporting from 3DSMax. But my english (and portuguese) is little..
    I try in Eglish:

    Can i use the classic code:            

    Matrix[ transforms = new Matrix[model1.Bones.Count];
     model1.CopyAbsoluteBoneTransformsTo(transforms);


    to trasform my coordinates?

    Because the model (and animation bones directions) are "staggered"...

    Tank you for reply.

     

  • 7/5/2008 6:31 PM In reply to

    Re: NEW Animation Library

    Hi,

    Thanks for your kindly words! =) Sorry but I do not speak Italian..

    WILEz:

    Can i use the classic code:            

    Matrix[ transforms = new Matrix[model1.Bones.Count];
     model1.CopyAbsoluteBoneTransformsTo(transforms);
    Yes you can do that. The SkinnedModel class encapsulates a model object, allowing you to do the CopyAbsoluteBoneTransformsTo, and in the SkinnedModelBasicEffect you can set it as the World matrix. Finally, you can set the bones in the Bones propert of the SkinnedModelBasicEffect.

    I will update the samples in the next release to show that it is possible! =)  Thansk!

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 7/31/2008 2:14 AM In reply to

    Re: NEW Animation Library

    Hi bruno,

    i am trying to use xnanimation library in xna game studio express, but inside my game solution explorer when i right click on References items and click add Reference i can't find the xnanimation files. i am using visual studio 2005.

    Also i came to know about your library from "MasterSlowPoke" on xna creative forum, and i find it very interesting. As it will be a great help of me because i am doing my MSc project on implementing characters in xna. I downloaded your library version but when giving the reference i can't find them. Is there any tutorial available.

    can you please tell me whats wrong.

     

  • 7/31/2008 4:31 PM In reply to

    Re: NEW Animation Library

    Hi. Sorry for the late reply.

    Are you using XNA Game Studio 2.0? Or 1.1? If you are using the 2.0 it should work. Do not copy the XNAnimationPipeline to your project directory, just add a reference for it in its default folder (XNAnimation/Windows). It is because the XNAnimationPipeline assembly uses the XNAnimation assembly! =)

    I also made an article about animation for the Ziggyware, which explains how to use the library.
    You can check it here: http://www.ziggyware.com/readarticle.php?article_id=190

     

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 7/31/2008 5:06 PM In reply to

    Re: NEW Animation Library

    its ok bruno, i am not in a hurry.

     

    well i am using xna game studio express 1.0. can u tell me how i can upgrade to xna game studio 2.0.

    well i have already gone through with your article on ziggyware, and find it very interesting. its just i can't be able to put the references right. i think i should upgrade to game studio 2.0.

    cheers.

  • 7/31/2008 10:04 PM In reply to

    Re: NEW Animation Library

    Hi.You should use the latest XNA version, since it provides the latest features. For example, if you wanna compete in the Dream Build Play you should make a game with XNA 2.

    You will not be able to use the XNAnimation with the XNA 1.1 because the assemblies were compiled with the XNA 2 assemblies, so they are not compatible with XNA 1.1 You need to install XNA GS 2.0 in order to use them.

    Installing XNA 2.0 is very similar to XNA 1.1. You just need to install Visual Studio 2005 (any version), and then the XNA Game Studio 2.0. There's also a tool available to migrate projects if I'm not wrong.

    EDIT: Here is the link for the project upgrade wizard: http://creators.xna.com/en-us/utilities/project_upgrade_wizard

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 8/2/2008 4:26 PM In reply to

    Re: NEW Animation Library

    hi,

    i am trying to install the xnanimation but i think there is something wrong with my visual studio, i have installed xna game studio 2.0, but it still didn't work with xnanimation. it will be very nice if you send me links to all the necessary installments to use xnanimation.

     

    i have already installed these things in my system.

    Microsoft visual c# 2005 Express Edition - ENU

    Microsoft XNA Framework Redistribuable 2.0

    Microsoft XNA Game Studio 2.0

    Window Vista.

    thanking in advance.

     

  • 8/3/2008 4:11 AM In reply to

    Re: NEW Animation Library

    Hi. I believe you are missing the Visual Studio Service Pack, which you need to install before you install XNA Game Studio 2.0.
    Also you don't need to install the redistributable pack.

    Check the "Join the XNA Creators Club and Download XNA Game Studio" section in this link: http://creators.xna.com/en-US/create_detail.

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 8/5/2008 7:22 PM In reply to

    Re: NEW Animation Library

    hi bruno,

    thanx a lot man, it works now,

    cheers. :-)

     

  • 8/6/2008 6:02 PM In reply to

    Re: NEW Animation Library

    bruno,

    please can you help me in finding some good book or material which can give me information about using external libraries for animation, like xnanimation. or which will help me in getting information about animating characters in xna directly.

     

    cheers.

    regards.

  • 8/6/2008 11:16 PM In reply to

    Re: NEW Animation Library

    Hi. One very good course on computer animation that you can download the slides is the "CSE169: Computer Animation - Steve Rotenberg - UCSD". I learned a lot reading these slides.

    I wrote a tutorial about animations on XNA and XNAnimation, you can check it at Ziggyware.
    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 8/7/2008 3:06 PM In reply to

    Re: NEW Animation Library

    bruno,

    thanx a lot for the reply, well no doubt these slides are amazing, but they are openGL based.

    cheers.

     

  • 8/7/2008 3:17 PM In reply to

    Re: NEW Animation Library

    Hi. There are only a few chunks of code in the slides, and although it is OpenGL the code is very simple. But the good point in the slides are the theory that they cover.

    Bruno Evangelista,
    Homepage | XNAnimation
    Ziggyware Article: Playing Nice Animations with XNA
    For what will it profit a man if he gains the whole world and forfeits his soul? Or what will a man give in exchange for his soul?, Matthew 16:26
  • 8/13/2008 6:01 PM In reply to

    Re: NEW Animation Library

    bruno,

     

    the theory link you send me is proper amazing, :-)

    kind regards.

     

  • 8/14/2008 6:42 AM In reply to

    Re: NEW Animation Library


    Sorry for my bad english, i'm always italian :)

    I'have two questions, one reguard the Bones Position and one, the AlphaBlending.

    1. I want "attach" an object to another skinned object (a sword on the hand of my model). I need know the Vector3 and trasform Matrix of the hand bone to attach the weapon to the hand in the animation... How i can?

    2. How i can use the alphaBlending in my skinned model? The classic metod dont work.
    I find this post:

    I'm sorry to start a new thread on this, is there a more appropriate place to report small bugs?

    Anyway, there's a bug on your BasicPaletteEffect pixel shader that ignores the textures' alpha channel.

    In BasicPaletteEffect.cs, PixelShaderCode property, the output.color.w should be set to the texture's alpha when you have a texture and no light:

    if (LightingEnable == false && TextureEnabled)
    {
        output.color.xyz = tex2D(TextureSampler,input.texcoord).xyz * saturate(EmissiveColor + DiffuseColor);
     
        // ADD THIS LINE:
        output.color.w = tex2D(TextureSampler,input.texcoord).w;
    }
     



    also, when there's no texture nor light, the alpha value should be the same as the diffuse alpha:

     
    // Same as above, except no texture
    else if (LightingEnable == false)
    {
        output.color.xyz = saturate(EmissiveColor + DiffuseColor);
     
        // ADD THIS LINE:
        output.color.w = DiffuseColor.w;
    }
     



    and in the remaining case (light and texture), it should be something like:

     
    else
    {
       
        // These comments are old but I left them in because they give some idea of how the lighting
        // works.  Lighting is now done in the vertex shader because older 2.0 cards didn't
        // support pixel shader lighting (like radeon 9800)
        // For phong shading, the final color of a pixel is equal to
        // (sum of influence of lights + ambient constant) * texture color at given tex coord
        // First we find the diffuse light, which is simply the dot product of -1*light direction
        // and the normal.  This gives us the component of the reverse light direction in the
        // direction of the normal.  We then multiply the sum of each lights influence by a
        // diffuse constant.
        // Now we do a similar strategy for specular light; sum the lights then multiply by
        // a specular constant.  In this formula, for each light, we find the dot product between
        // our viewDirection vector and the vector of reflection for the light ray.  This simulates
        // the glare or shinyness that occurs when looking at an object with a reflective surface
        // and when light can bounce of the surface and hit our eyes.
        // We need to be careful with what values we saturate and clamp, otherwise both sides
        // of the object will be lit, or other strange phenomenon will occur
        // Now we apply the aforementioned phong formulate to get the final color
     
        output.color.xyz = TextureEnabled ? tex2D(TextureSampler, input.texcoord).xyz  * input.color.xyz
            : input.color.xyz;
     
     
        // ADD THIS LINE
        output.color.w   = TextureEnabled ? tex2D(TextureSampler, input.texcoord).w : input.color.w;
     
    }
     



    Hope it helps

    Cheers,

    Joao

       
    Reply
    dastle
    Coordinator
    Feb 19 2007 at 9:44 PM
    Edited Feb 19 2007 at 11:06 PM
       
    Thanks, I'll fix this.

    You can report bugs in the "issue tracker" tab.

    Actually, setting the w value in the "if" statements crashes the xbox (!!!!!). Also, diffuse materials don't have alpha components in XNA.

    So I copied what BasicEffect does and added an Alpha property to BasicPaletteEffect. I fixed the source code by changing the last line to:

            output.color.w   =
                TextureEnabled ? tex2D(TextureSampler, input.texcoord).w * Alpha : Alpha;



    But i cant find "your BasicPaletteEffect pixel shader"..where is it?


    Please, help me!

     

Page 1 of 2 (36 items) 1 2 Next > Previous Next