Skip to content Skip to sidebar Skip to footer

Gluproject Not Working... If The Object Haves Z=-1.0f And It Is Scaled To (0.01f,0.01f,0.0f) Which Parameters I Have To Pass To Gluproject?

Until now, I worked with gluProject, perspective projection, and a zoomable square centered on the screen with a lower left vertex (-1,-1,0). I zoom the square adjusting the Z axis

Solution 1:

Again and again and again:gluProject does exactly the same thing like the OpenGL transformation pipeline (if called with OpenGL's matrices and viewport, of course). So whatever vertices you send to OpenGL, these are the vertices you have to put into gluProject.

If you render the polygon using the vertex (-1,-1,0), then you have to call gluProject with this vertex. Every other transformation (be it translation, scaling, rotation, or whatever) comes from the transformation matrices. But if you indeed render the polygon using the vertex (0.01, 0.01, 0), then you have to put this into gluProject.

Make sure you completely understand the OpenGL transformation pipeline (the answers to this question may help) and the workings of gluProject before continuing to use it and posting questions for every little input that you think gives wrong results.

Post a Comment for "Gluproject Not Working... If The Object Haves Z=-1.0f And It Is Scaled To (0.01f,0.01f,0.0f) Which Parameters I Have To Pass To Gluproject?"