It seems the gluProject method maps object coordinates to window coordinates. It's C declaration is:
and winX, winY and winZ are indeed output variables according to:Code:GLint gluProject ( GLdouble objX , GLdouble objY , GLdouble objZ , const GLdouble *model , const GLdouble *proj , const GLint *view , GLdouble* winX , GLdouble* winY , GLdouble* winZ );
Parameters
objX, objY, objZ
Specify the object coordinates.
model
Specifies the current modelview matrix (as from a glGetDoublev call).
proj
Specifies the current projection matrix (as from a glGetDoublev call).
view
Specifies the current viewport (as from a glGetIntegerv call).
winX, winY, winZ
Return the computed window coordinates.
Question is: Does it transform one coordinate at a time? If this is the case you should do:
Code:GLdouble SWinCoorX; GLdouble SWinCoorY; GLdouble SWinCoorZ
and use them as:
Code:... gluProject(SObjectCoorX[i], SObjectCoorY[i], SObjectCoorZ[i], SmodelMatrix, SprojMatrix, SpVport->Port, &SWinCoorX, &SWinCoorY, &SWinCoorZ);
See this example:
gluProject sample




Reply With Quote