3D Graphics Sample
This sample demonstrates several basic topics in 3D graphics utilization, including how to load a 3D model by using the XNA Content Pipeline; how to manipulate the model, the view, and the lighting; and how to incorporate 2D graphics assets and make them interact with the loaded model.Sample Overview
The sample constitutes of a game that renders a 3D model of a spaceship and allows the user to alter the way the model is rendered and displayed. Initially, the model is rendered against a clear blue background using three different light sources.
By using various on-screen buttons and drag gestures, the user can control the game in ways that demonstrate the different topics that are the focus of this sample.
Sample Controls
- The buttons in the upper-right corner of the screen can be used to toggle the three individual light sources, changing the way the model is lighted.
- The button in the lower-right corner of the screen allows for enabling and disabling per-pixel lighting. This functionality allows the user to see the difference the enhanced lighting calculation has on the model's rendering.
- The button in the lower-left corner of the screen toggles a sprite animation that is drawn in front of the model.
- The button in the upper-left corner of the screen changes the model's background from a solid blue color to a star-field texture.
- Dragging the model horizontally or vertically causes the model to rotate in an intuitive matter.
- Pinching or stretching causes the model to zoom out and zoom in, respectively.