CNA Samples

3D Graphics

Ported from Microsoft's XNA 4.0 Graphics 3D Sample.

Source for this sample on GitHub ↗

A green and white spaceship with six on-screen controls against a blue background. Play ▸

Opens in a new tab.

About this sample

A model lit by three independent directional lights demonstrates per-vertex and per-pixel lighting. The controls also switch the starfield background and an explosion animation.

Controls

ActionMouse or touch
Toggle the three lightsThree buttons at the top right
Toggle the starfieldButton at the top left
Toggle per-pixel lightingButton at the bottom right
Toggle the explosion animationButton at the bottom left
Rotate the spaceshipDrag with one finger or the left mouse button
ZoomPinch with two fingers on a touch screen