MonoGame (new XNA) Tutorial:      3D Game with SkinnedMesh, Animation Blending, 3rd Person Cam & Shadow

This tutorial is a part(#4) of a multi-lesson series on how to program 3D games with monogame in c#. It starts by teaching how to export and import FBX skinned-mesh animations and how to blend them based on analog control which determines the character speed. This way you can blend between idle, walk and run and could extend this to jumping and other animation blends. The camera smoothly follows along behind the character and the other analog can be used to smoothly rotate or tilt the camera relative to the character. To make it look a bit better, a simple shadow matrix is used to create a shadow which works on relatively flat areas. For maps with a lot of changing elevation (or platforms), a different type of shadow shader would be recommended

Source Code:
SkinnedMesh 3D Game Source Code

The first video tutorial can be found here:
3D Game Programming Series - Video 1

This is the YouTube video which contains the full tutorial. Below I will add some extra notes which may be helpful. (Later I'd like to work on another FBX importer which can handle strange and more complex rig exports [also will embed textures]).


TIPS:

- If you don't want to build the DLL's needed for the assembly yourself, you can get them in the source code above. At this moment, I'm not sure if these work on every platform so you may need to find the skinnedmesh example and build for your target platform.
- If the FBX ends up exporting with animated curve nodes on the geometry/mesh itself, you may need to use ctrl-F and search in the file and remove these for the geometry mesh object - there should be 3 curve nodes (translation, rotation, scale). This will confuse the importer because it doesn't expect animation on the original mesh itself.
- you can use ctrl-H to replace the relative paths "../blabla/some3Dprogram/someFolder/texture1.png" with the proper folder path which could be something like "../texture1.png" or "../MyModels/texture1.png"
- some fbx importers only work well with a single mesh due to the odd way offset matrices are stored differently for different mesh
so in order to prevent that problem (if using 3DS), you can combine the different skinmesh using a skinwrap modifier and they will work the same as before. I plan to make a video tutorial to cover this issue and what to do.
- if you get a problem with skin tag, make sure you've set your model to use the SkinnedModel processor
- I believe exporting with the option to name by scene, it'll rename "Take 001" to the scene name.
- You can get the child transform of a character part (like "hand") to place something in their hand.


>>> Click here to go to back to Game Design <<<