|
1 year ago | |
---|---|---|
.. | ||
Animation | 1 year ago | |
ContentReaders | 1 year ago | |
Graphics | 2 years ago | |
Properties | 1 year ago | |
Aether.Animation.NET4.DX.csproj | 1 year ago | |
Aether.Animation.NET4.XNA.csproj | 2 years ago | |
Aether.Animation.NET4.csproj | 1 year ago | |
Aether.Animation.NETSTANDARD.DX.csproj | 1 year ago | |
Aether.Animation.NETSTANDARD.csproj | 1 year ago | |
Aether.Animation.UAP.csproj | 1 year ago | |
README.md | 2 years ago |
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).
-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();
}