PDA

View Full Version : value returned by gluUnProject



ss122
01-27-2007, 02:10 AM
in the line given below, if i print the value of objX,objY,objZ using the printf statement, do i get the world co-ordinates of x, view[3]-y, 1.0?

gluUnProject( x, view[3]-y, 1.0, model, proj, view, &objX, &objY, &objZ) ;

and, if i use gluProject to try and get back the window co-ordinates of objX,objY,objZusing the code below, shouldn't the values that are returned be the same as that of x, view[3]-y, 1.0?

gluProject(objX,objY,objZ,model, proj, view,&a,&b,&c);

Overmind
01-27-2007, 06:29 AM
Yes, they should be roughly the same. They won't be exactly the same because of rounding errors.