Original Post
Hi, I have a need in my project to 'software transform' some vertices before sending them down to the T&L hw for final transform and projection. However, its been ages since I had to do this (back in the Amiga and 386 days!) and I have obviously forgotten the old skills :( Here is the code: // Transform the normal D3DXVec3Transform(&vec,&Vertex.m_vNormal,&mat); Vertex.m_vNormal.x = vec.x; Vertex.m_vNormal.y = vec.y; Vertex.m_vNormal.z = vec.z; D3DXVec3Normalize&Vertex.m_vNormal,&Vertex.m_vNormal); // Add in translation and scale D3DXMatrixScaling(&scale,0.5f,0.5f,0.5f); D3DXMatrixTranslation(&translation,fX,fY,0.0f); D3DXMatrixMultiply(&mat,&mat,&scale); D3DXMatrixMultiply(&mat,&mat,&translation); // transform the coordinates D3DXVec3Transform(&vec,&Vertex.m_vPos,&mat); Vertex.m_vPos.x = vec.x; Vertex.m_vPos.y = vec.y; Vertex.m_vPos.z = vec.z; And I render the above lot with a identity world matrix so in theory should mean that the end result is transformed by view and projection. Now, if I render the above with the software transform the lighting is darker than without the software transform (with the same rotation/scaling/translation parameters). I am obviously munging up the normal transformation or my basic assumptions are just plain wrong... Can anyone spot the error?