Nikos Kastellanos 080463f547 TargetFrameworks 10 tháng trước cách đây
..
Animation ea3ea950ef types 1 năm trước cách đây
ContentReaders ea3ea950ef types 1 năm trước cách đây
Graphics 3ba9fa94ec rename namespace 3 năm trước cách đây
Properties f52c986305 v1.4.0.0 1 năm trước cách đây
Aether.Animation.NET4.DX.csproj 0f7c9b6605 update Framework (v4.0) 10 tháng trước cách đây
Aether.Animation.NET4.XNA.csproj 3b498c2bca seperate Artifacts 3 năm trước cách đây
Aether.Animation.NET4.csproj 0f7c9b6605 update Framework (v4.0) 10 tháng trước cách đây
Aether.Animation.NETSTANDARD.DX.csproj 080463f547 TargetFrameworks 10 tháng trước cách đây
Aether.Animation.NETSTANDARD.csproj 080463f547 TargetFrameworks 10 tháng trước cách đây
Aether.Animation.UAP.csproj 0f7c9b6605 update Framework (v4.0) 10 tháng trước cách đây
README.md 3ba9fa94ec rename namespace 3 năm trước cách đây

README.md

nkast.Aether.Animation.*

Play animated 3D models and support for CPU animation. CPU animation is optimized using unsafe code, writing directly to mapped VertexBuffer memory using reflection (DirectX).

Importers

  • 'Animation' - Import animations from a Model.
  • 'GPU AnimatedModel' - Import an animated Model.
  • 'CPU AnimatedModel' - Import an animated Model to be animated by the CPU. Based on DynamicModelProcessor, the imported asset is of type Microsoft.Xna.Framework.Graphics.Model where the VertexBuffer is replaced by a CpuAnimatedVertexBuffer. CpuAnimatedVertexBuffer inherits from DynamicVertexBuffer.

Example

-Import 3D model with GPU AnimatedModel or GPU AnimatedModel Processor. Use SkinnedEffect for GPU and BasicEffect for CPU based animation.

-Load as any 3D Model:

_model = Content.Load<Model>("animatedModel");

-Load the Animations from model:

_animations = _model.GetAnimations();
var clip = _animations.Clips["ClipName"];
    _animations.SetClip(clip);

-Update animation on every frame:

    _animations.Update(gameTime.ElapsedGameTime, true, Matrix.Identity);

-Draw GPU animation:

foreach (ModelMesh mesh in _model.Meshes)
{
    foreach (var meshPart in mesh.MeshParts)
    {
        meshPart.effect.SetBoneTransforms(_animations.AnimationTransforms);
        // set effect parameters, lights, etc          
    }
    mesh.Draw();
}

-Draw CPU animation:

foreach (ModelMesh mesh in _model.Meshes)
{
    foreach (var meshPart in mesh.MeshParts)
    {
           meshPart.UpdateVertices(animationPlayer.AnimationTransforms);
           // set effect parameters, lights, etc
    }
    mesh.Draw();
}