There are some confusions about the Microsoft's DirectX10 SDK document about D3DXVec3TransformNormal.
The correct meaning of "D3DXVec3TransformNormal" is that "D3DXVec3TransformNormal transforms a normal using the transpose of the inverse of the given matrix". However, the DirectX SDK says: "If you want to transform a normal, the matrix you pass to this function should be the transpose of the inverse of the matrix you would use to transform a point.". The SDK document means that you should inverse your input matrix and then transpose it manually and then give it as parameter to the function "D3DXVec3TransformNormal". But as a matter of fact, you just have to input the transformation matix, and DirectX would do inversion/transpotion for you.
There are some details as follows for the function of "D3DXVec3TransformNormal" if you want to know:
Normals are different than vertex positions in that they always have their origin at 0,0,0 (i.e. they don't have a position) and they shouldn't be scaled or skewed.
For this reason, when transforming normals:
1. You shouldn't apply any translation.
继续阅读
