Microsoft DirectX 9.0

Vertex Tweening

Vertex tweening is used to blend two user-provided positions or normal streams. It can be used only with declarations. Tweening is enabled by setting D3DRS_VERTEXBLEND to D3DVBF_TWEENING. Vertex blending using weights and vertex blending tweening are mutually exclusive.

The C++ Dolphin VS Sample uses vertex tweening to animate a dolphin so that it appears to move through the water. The images below show the dolphin at two different points. Notice that the dolphin's tail has gone from an up position to a down position and its nose points downward more in the right image.

Dolphin images with tail up and tail down

Tweening is performed before lighting and clipping. The resulting vertex position (normal) is computed as follows:

POSITION = POSITION1 * (1.0 - TWEENFACTOR) + POSITION2 * TWEENFACTOR, and likewise for normals.

Additional information is contained in the following topic.


Vertex Shader Tweening

The code for using vertex shader tweening is similar to the code for the fixed-function tweening shown in the Using Vertex Tweening topic.

© 2002 Microsoft Corporation. All rights reserved.