I'm trying to create a flat plane such that it perfectly fills the viewport in an OpenGL ES application. I can achieve this effect by creating the plane and then experimentally moving it forwards and backwards until I get the right effect, but I'm certain that it must be possible to work out exactly how far away from the camera it should be. I would welcome any pointers!
I need to be accurate because the plane has a texture applied to it, which I want to fill the window and not be clipped at all.
Thanks!
Use glFrustum instead of gluPerspective to set the perspective projection. With glFrustum you define the projection in terms of a plane you want to display viewport-filling. Pseudocode:
Projecting rays through the screen/viewport corners onto your plane should give your the correct vertices for the corners.