Advertisement

custom projection matrix

Started by April 04, 2002 06:04 AM
1 comment, last by qingrui 22 years, 10 months ago
| 1 0 0 0 | | 0 1 0 0 | |-x/z -y/z 0 -1/z| | 0 0 0 1 | this projection matrix generates unexpected result, while | 1 0 0 0 | | 0 1 0 0 | |-x/z -y/z 0 0 | | 0 0 0 1 | generates the expected result. why can''t the last column be something else than (0, 0, 0, 1)''
a) it depends on what you expect.
b) it can be, if you know what you are doing (and what to expect).
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Advertisement
i want to project some model to the xOy plane.
and i think the matrix
-z 0 0 0
0 -z 0 0
x y 0 1
0 0 0 -z
is right.
it works when i multiply vectors with the matrix myself, but generates wrong result(infinite far) when using OpenGL.
so i want to ask why and how to solve it.
(transposing is already considered)

This topic is closed to new replies.

Advertisement