Hey, I read a whole bunch about the procedures/functions you mentioned, but when I tried using them, it didn't work!

I have a few questions tht might help...

-Why does this not work:
Code:
Procedure Matrix_to_Win;
var model, proj, Winx,Winy,Winz : PGLdouble;
    Matrixx,Matrixy,Matrixz : real;
    view : PGLint;
begin           
 {view := 0;
 model := GL_MODELVIEW;
 proj := GL_PROJECTION;}
 Winx := 0; Winy := 0; Winz := 0;
 Matrixx := 0; Matrixy := 0; Matrixz := 0; 

 glGetDoublev(GL_MODELVIEW_MATRIX, model);
 glGetDoublev(GL_PROJECTION_MATRIX, proj);

 glGetIntegerv(GL_VIEWPORT, view);


 gluProject(Matrixx, Matrixy, Matrixz,
               model, proj, view,
               Winx, Winy, Winz);
end;
I found that in an example they had on the internet, but it doesn't seem to work. Any clues?
I tried commenting out all the gl lines but one to see where the problem was but they all bugged! lol

-The gluProject 'returns' WinX, WinY and WinZ, right? bt those are the coordinates of the screen, right? then why a Z coordinate? :scratch:

-Does it return coordinates outside the screen too?

-If I want to use the Win coordinates, i'd like to make them integers, how do I do that?
How to convert PGLdouble to LongInt?
Double to longint?

Cheers