I'm still pretty new to this GL stuff, but I've managed to put together some C and C++ code that allows me to construct simple 3D objects consisting of line segments and display them on my laptop using GLFW and the glm library. I've hooked in enough keyboard callbacks to allow me to navigate the position and orientation of an observer via glm::lookAt(). A couple of the keys allow me to grow or shrink the field of view value that gets passed to glm::perspective(), like so:
float field_of_view; // degrees, not radians
glm::mat4 proj = glm::perspective(
glm::radians(field_of_view), // field of view
1920.0f / 1080.0f, // aspect ratio
0.0f, 100.0f // near and far clipping planes
);
From my experience as an amateur photographer, I know that if one takes a photo with a camera with a wide angle lens of a scene that contains straight line near the periphery of the field of view, the physically straight lines will appear bent in the photo. They bow outward so as to create a more circular shape around the center of view.
But when I modify the field of view that gets passed to glm::perspective() such that it is a high value (approaching 180 degrees), with an orientation such that the straight line segments appear near the edges of the field, the rendered line segments never bend like I'd see with a real camera and wide angle lens. Instead, the lines remain straight but appear to get very long.
This creates very unnatural looking images.
Is there some other glm function that I should call instead in order to make the rendered lines curved like I'd expect to see in real life?
Thanks