glFrustum and field of view

glFrustum(), which I find easy and intuitive to use,
also implicitly specifies the field-of-view/projection.
However, the problem with that is that, suppose I’m close
to an enclosure on one side, that enclosure polygon will
get clipped and whatever is outside it will be rendered.

I believe I can fix this by modifying the projection to
“zoom in” one I’ve set the frustum; can anyone give me
some pointers to how that is accomplished? Thanks in
advance.

I answered my own question. Thanks, me.

glFrustum(-1., 1., -1., 1., 1., 40.);
glScalef(1.1, 1.2, 1.1);

This seems to give OK proportions and avoid the clipping
of near-side polygons revealing what’s behind (I don’t
allow the viewer to come closer than 0.5 units from the
edge). The 1.2 to 1.1 ratio is to compensate for my
window’s aspect ratio.

Remeber to recalculate all of your normals. glScale won’t do it for you.

Thanks for the reminder.

Talking this over with a friend and drawing it out on a
conveniently located whiteboard, I realized I was confused
about what I wanted to do; just bringing the near plane
closer and also scaling in the left/right/top/bottom
distances
was what I really wanted; that will preserve
the field of view while not allowing half-clipped barriers
on the sides.