Coded infinite shadows, now gluPickMatrix doesnt work!

The significant change that I see here is that I am now using an infinite projection matrix. I am wondering, how do I go about fixing this? Im thinking mebbe I should use a standard matrix just for picking. Is there a more valid way around this problem?

Unless you are trying to pick the shadow volumes themselves, maybe you should just omit the volumes from the picking pass.

That’s not the problem, what the problem is is the perspective matrix. I have set up the picking matrix and non-infinite projection matrix. It doesn’t match what’s visible perfectly, but it does select the appropriate mesh usually. There’s a decent amount of inaccuracy the further you get from the center of the view. I can clean up the error by moving the far plane further out, but I don’t know how far I want to go.

Sorry, I don’t understand what you’re saying then.

Well, I guess I can survive with the picker in its current state. Maybe I can squeeze some more accuracy out of it.

It turns out when the projection matrix is loaded with an infinite matrix, whenever I tried to pick out something which has been clicked on, it only selects what’s in the upper right hand corner of the view.

A spatial disparity that increases towards the edge strongly suggests a simple frustum miscalculation. You might want to try drawing with the same matrix you pick with and compare the view with the correctly rendered scene.

[This message has been edited by dorbie (edited 03-05-2003).]

The disparity at this point is slight enough for me to not worry about it.