CNA Samples

Avatar Animation Blending

Ported from Microsoft's XNA 4.0 Avatar Animation Blending Sample for Xbox 360.

Source for this sample on GitHub ↗

The running sample: a CNA avatar on a blue background with animation blending enabled. Play ▸

Opens in a new tab. Click the game canvas to focus the keyboard. CNA supplies its own avatars and preset motions; their appearance and timing differ from Xbox avatars. Keyboard emulation is enabled alongside gamepad input. Documented differences ↗

About this sample

The sample switches a random avatar between Stand, Celebrate, Clap and Wave. Its own animation implementation interpolates every bone's rotation and translation over 250 milliseconds, producing a smooth transition between the old and new poses. Toggle blending to compare that transition with an immediate switch.

The same camera controls let you inspect the motion from different angles, and the right shoulder button creates another random avatar.

Controls

ActionKeyboardGamepad
Celebrate / Clap / Stand / WaveK / L / J / IA / B / X / Y
Toggle blendingQLeft shoulder
New random avatarERight shoulder
Orbit cameraArrow keysRight stick
Zoom out / inZ / CLeft / right trigger
Reset cameraRight ShiftRight stick click
Stop the sampleEscapeBack