Search code examples
openglviewportfrustum

Render cropped image in OpenGL


I want to render a scene with specific camera parameters where the resolution is very high (say 20,000 x 20,000 pixels), but I actually am only interested in doing a small 640x480 section of the image plane.

I don't necessarily want to just zoom in on the section and alter where the camera is pointing. I want the camera to stay pointing in the same direction, I just only want to render a small portion of the scene.

I have attached a picture to try and show what I am talking about: Uploaded image

Any hints on how I can setup the camera matrix with OpenGL calls properly for something like this?


Solution

  • I think libtr will do what you want.