|Microsoft DirectX 9.0|
The Vertex Blend sample demonstrates a technique called vertex blending, also known as surface skinning. It displays a file-based object that is made to bend in various spots.
Vertex blending is used for creating effects such as smooth joints and bulging muscles in character animations.
Not all cards support all features for vertex blending. For more information about vertex blending, refer to the Microsoft?DirectX® software development kit (SDK) documentation.
Source: (SDK root)\Samples\C++\Direct3D\VertexBlend
Executable: (SDK root)\Samples\C++\Direct3D\Bin
The following table lists the keys that are implemented. You can use menu commands for the same controls.
|ENTER||Starts and stops the scene.|
|SPACEBAR||Advances the scene by a small increment.|
|F2||Prompts the user to select a new rendering device or display mode.|
|ALT+ENTER||Toggles between full-screen and windowed modes.|
|ESC||Exits the application.|
|CTRL+V||Switches between a custom vertex shader and Microsoft Direct3D?vertex blending.|
Vertex blending requires each vertex to have an associated blend weight. Multiple world transforms are set up using SetTransformState and the blend weights determine how much contribution each world matrix has when positioning each vertex.
In this sample, a mesh is loaded using the common helper code. Note how a custom vertex and a custom flexible vertex format (FVF) is declared and used to build the mesh; see the SetFVF call for the mesh object. Without using the mesh helper code, the technique is the same. Create a vertex buffer full of vertices that have a blend weight, and use the appropriate FVF.
This sample uses common DirectX code that consists of programming elements such as helper functions. This code is shared with other samples in the DirectX SDK. You can find the sample framework headers and source code in (SDK root)\DXSDK\Samples\C++\Common\Include and (SDK root)\DXSDK\Samples\C++\Common\Src.