I'm writing some code that transforms vectors with matrices in D3DX9. When is the correct time to use w=0 and w=1? The MSDN documentation is not terribly helpful in this reg开发者_如何学编程ard.
When the vector is representing a direction (e.g. a vertex normal) w should be zero, If the vector is representing a point in 3d space (e.g. location of a vertex) then w = 1.
精彩评论