PDA

View Full Version : Glut version of D3DXVec2TransformCoord() ?



cronodragon
07-11-2007, 09:43 PM
Is there a function like D3DXVec2TransformCoord() in OpenGL/GLUT? According to MSDN docs:

"This function transforms the vector, pV (x, y, 0, 1), by the matrix, pM, projecting the result back into w=1."

Thanks in advance!
-Marco

EDIT: I can do the transformation, but I have no idea what they mean with projecting the result back into w=1. :?

LP
07-11-2007, 10:14 PM
EDIT: I can do the transformation, but I have no idea what they mean with projecting the result back into w=1. :?
Just divide the contents of 3D vector (including "w" itself) by "w". You may also need to multiple the result by your viewport size and center it on the screen.

cronodragon
07-11-2007, 11:49 PM
Ready! Thanks. No need to use the viewport or centering on the screen. :D