The Animation Library provides the ModelViewer class to help you quickly view your animated models. It works very similar to the directx mesh viewer.
- Unlike the ModelAnimator, the ModelViewer object uses its own view and projection matrices.
- Create an instance of the ModelViewer using the dwarf model (you might want to disable dwarfAnimator temporarily)
- Run the idle animation as described in the previous tutorial section. You can access the viewer's animators via the ModelViewer.Animators property. The dwarf animator will be at index 0:
// Add this to LoadGraphicsContent after temporarily disabling dwarfAnimator
ModelViewer viewer = new ModelViewer(this, model);
ModelAnimator animator = viewer.Animators;
RunController(animator, idle);
- To rotate the model, click and drag the left mouse button.
- To rotate the camera around the model (and see the lighting), click and drag the right mouse button.
- To zoom in and out, use the mouse wheel.