Re:Perspective simulation

New Message Reply Date view Thread view Subject view Author view

Christophe DELEPINE (CHRISTOPHE.C.D.DELEPINE++at++TTS.thomson.fr)
Tue, 9 Jan 1996 11:30:14 +0100


Angus,

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!

delepine++at++tts.thomson.fr


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:14 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.