Question

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?

Était-ce utile?

La solution 2

I think libtr will do what you want.

Autres conseils

All you need to do is to select a different projection matrix. The old reference pages for glFrustum describe how to create such a matrix:

projection matrix

The left, right, top, and bottom parameters specify the edges of your frustum (as shown in your picture). To make a "normal" projection matrix, left = -right, and top = -bottom. Setting them to different values allows you to constrain your view. For instance, if you set left = 0 and top = 0 while leaving right and bottom intact, then you would have a projection similar to the red regions in your picture.

If you figure out the values you are currently using, it should be straightforward to tweak them to produce the result you want.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top