While I was going over some older DirectX code, I came by the functions D3DXVec3Transform and D3DXVec3TransformCoord. Upon looking up the descriptions for them, they seemed rather similar but I don't see what the difference between the two are. Can someone please explain what is the difference between D3DXVec3Transform and D3DXVec3TransformCoord are, along with the math behind them?
Asked
Active
Viewed 1,256 times
1 Answers
3
When you transform a 3D vector by matrix it results in a 4D vector where w!=1
a 3D vector can be described as 4D vector where w=1.
D3DXVec3Transform returns the 4D vector where w!=1. D3DXVec3TransformCoord gets the 4D vector and the projects it onto w=1 to make it 3D vector.
EDIT: And here is the paper I google'd and found if interested in how to do the transformation: http://www.heldermann-verlag.de/jgg/jgg01_05/jgg0404.pdf

Gasim
- 7,615
- 14
- 64
- 131