CNA Samples

Object Placement on Avatar

Ported from Microsoft's XNA 4.0 Object Placement on Avatar Sample for Xbox 360.

Source for this sample on GitHub ↗

The running sample: a CNA avatar holding a baseball bat near its right hand. 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 calculates the world transform of every avatar bone from its animation, bind pose and parent. A baseball bat uses the transform of the right-hand SpecialRight bone with the original small position and rotation offset.

Compare Stand, Celebrate, Clap and Stand 5 while the bat follows the hand. The fingers continue animating and do not grip the bat, as in the original. You can orbit the camera or create another random avatar.

Controls

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