   Texture Transform Matrix......
  The code below set terxture transform for a reflection texture.(use render to textuer)I didn''t understand what''s they mean,what are they doing???Why do this transform.   //set the transform matrix    D3DXMATRIX  matProj,mat;    lpDev->GetTransform(D3DTS_PROJECT,&matProj);mat._11 = 0.5f; mat._12 = 0.0f; mat._13 = 0.0f;mat._21 = 0.0f; mat._22 =-0.5f; mat._23 = 0.0f;mat._31 = 0.5f; mat._32 = 0.5f; mat._33 = 1.0f;mat._41 = 0.0f; mat._42 = 0.0f; mat._43 = 0.0f;// Set up a transform for projected texturesmat._11 *= matProj._11;mat._22 *= matProj._22;mat._31 *= matProj._33;mat._32 *= matProj._33;mat._33 *= matProj._33;lpDev->SetTransform( D3DTS_TEXTURE0, &mat);
  Where''s the code sample from? ;  The projection matrix will transform camera space coordinates into projection space, which is basically a cube where -1 < x < 1 and -1 < y < 1. The additional matrix (mat) will transform those coordinates so that 0 < x < 1 and 0 < y < 1, i.e. valid texture coordinates. The lines after "// Set up a transform for projected textures" could be an optimised matrix multiply between the two, taking advantage of the zero's in each matrix. [edited by - treething on February 13, 2004 10:50:30 AM]