3x3 Matrix for 2D ?
I was skimming across the internet looking for 2D matrix math examples, when I found Sam's Publishing website... they had something about it on there for some reason. I looked at the tutorial and one thing stuck out to me. Why are they using a 2D vector with components x, y, and w? and why are they using a 3x3? I'm also curious as to what w ever did in the first place...
The short version: w is used in homogenous coordinate systems. Basically, it distinguishes between point vectors and direction/magnitude vectors; points having a w of 1 and direction/magnitude have a w of 0. This allows transformations to be applied in a uniform manner to both types of vectors.
If you are curious and know some linear algebra you may want to look up "projective geometry" on the internet, to see where the theory comes from. It's also a lot easier to visualise homogeneous coordinates in 2d (projected on the surface of a 3d hemisphere) than in 3d (projected onto a 4d hyperspehere).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement