开发者

3D Vector transformations - when to use w = 1

开发者 https://www.devze.com 2023-02-03 14:29 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消