How do Texture Transform matrices work?
The answer is – slightly oddly. If you are familiar with the OpenGL ones, forget them. These are subtly and confusingly different. So best just to forget them and start again. I am using the DirectX8 terminology here, but it translates fairly easily to DX7 or DX9. The basic operation is in four steps: (1) Coordinates (1-4 components) are fed into the texture transformation unit. (2) They are transformed by the matrix (i.e. a matrix multiply operation). (3) The components of the result may be divided by one of the components (used for projective texturing), and that component is discarded. (4) The results are fed to the texture units as texture coordinates. Step (1) is controlled by SetTextureStageState ( n, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_xxx ), where xxx is either: – PASSTHRU – you supply 1 to 4 values in the vertex itself. The number of components is determined by the FVF of the vertex, and the coordinate set is determined by the number order with D3DTSS_TCI_PASSTHRU. So passing in