Microsoft DirectX 8.1 (C++)

Setting Transformations

In C++, transformations are applied by using the IDirect3DDevice8_SetTransform method. For example, you can use code like the following to set the view transformation.

HRESULT    hr;
D3DMATRIX  view;

// Fill in the view matrix. 

hr = pDev->SetTransform(D3DTS_VIEW, &view);

if(FAILED(hr))
{
    // Code to handle the error goes here.
}

There are several possible settings for the first parameter in a call to SetTransform. The most common are D3DTS_WORLD, D3DTS_VIEW, and D3DTS_PROJECTION. These transformation states are defined by the D3DTRANSFORMSTATETYPE enumerated type. This enumeration also contains the states D3DTS_TEXTURE1 through D3DTS_TEXTURE7, which you can use to apply transformations to texture coordinates.