Christophe DELEPINE (CHRISTOPHE.C.D.DELEPINE++at++TTS.thomson.fr)
Tue, 9 Jan 1996 11:30:14 +0100
I found the error I was doing:
If P is the 4x4 perspective matrix and M = (x y z 1) the vertex coordinates, I do:
M' = P.M
I get M' = (x' y' z' w) with w=-z
Then I do: xs = x'/-z
ys = y'/-z (screen coordinates)
zs = z'/-z
This is the dividing by -z I was talking about.
If I send the GL command: glVertex3f(xs, ys, zs) this gives a correct wireframe
image.
but to get correct texture mapping, I should rather send:
glVertex4f(x', y', z', -z) and let the machine do the division.
That was it!
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:14 PDT