What’s bad with this code?
gluUnProject(u, view-i, 0.0, (double*)w3d->mm, (double*)w3d->pm,
(GLint*)view, &r, &r, &r);
gluUnProject(u, view-i, 1.0, (double*)w3d->mm, (double*)w3d->pm, (GLint*)view, &r, &r, &r);
I’ll say to you, what’s bad with this code.
With a small world, everythng is fine, but.
When I translate for more than 20.0 units from the origin, the ray resulting from the deceptive gluUnProject, doesn’t give to me the result I duly deserve.
Let me explain.
I have this world, with some spheres (it’s a game, ok), and you can click on said spheres, but. if you click on a sphere that’s too far from the origin.
Ahh, forgething, a.
OK my problem, to be clear, is that I coded a small raycaster to fully investigate my problem, and it seems that the spheres are smaller, when gluUnProject is used, than when they are drawn with gluSphere.
Any suggestion? I searched on google, but found nothing related to some offset problem with gluUnproject.
Im using only GLdouble and I am a bit tired.