Microsoft DirectX 8.0 (C++) |
Like the matrices that your application uses for geometry, you set and retrieve texture coordinate transformations by calling the IDirect3DDevice8::SetTransform and IDirect3DDevice8::GetTransform methods. These methods accept the D3DTS_TEXTURE0 through D3DTS_TEXTURE7 members of the D3DTRANSFORMSTATETYPE enumerated type to identify the transformation matrices for texture stages 0 through 7, respectively.
The following code sets a matrix to apply to the texture coordinates for texture stage 0.
// For this example, the d3dDevice variable contains a // valid pointer to an IDirect3DDevice8 interface. // D3DMATRIX matTrans = D3DXMatrixIdentity( NULL ); // Set-up the matrix for the desired transformation. d3dDevice->SetTransform( D3DTS_TEXTURE0, &matTrans );