glFrustum equivlanet in Panda3D

I would like to create an off axis projection matrix for the Panda3D camera.

(Equivalent to the glFrustum calls here

I saw one post on here ([url]Creating an off-axis projection in Panda3D]) about this, and it recommended just calling glFrustum directly.

I’m just evaluating whether I can use Panda3D at this point, so I don’t know a whole lot about it. This doc page seems to show Panda3D using a lens system analogy, but in this doc there seems to be no way to shift the “sensor” which, I suppose would be the equivalent operation in a camera.

So can I forgo making any PerspectiveLens call, and simply change the GL state underneath Panda3D by calling glFrustum with my own parameters, or is there a better way to do it?


Keep in mind that Panda has various methods for stereo rendering built-in - if you’re looking for stereo rendering, then Panda can do all of this stuff automatically.

If not, perhaps you’re looking for setFrustumFromCorners?

In any case, glFrustum just calculates and applies a projection matrix, so if the Lens methods don’t provide a way for you to set it appropriately, you can always calculate your own projection matrix and use a MatrixLens.

Thanks, that’s what I was looking for!

I’m glad this feature exists, but I’m also surprised that I couldn’t find it on my own. It’s not mentioned in the manual where the camera model is documented, and the figures there lead one to believe that the camera model doesn’t include those variables. If I type “frustum” into the python API search box I get “No Results” - even though typing setFrustumFromCorners finds that function. Googling “panda3d frustum” only returns a message board post with a suggestion to use glFrustum directly.

I think that the API search feature matches what you enter to the beginnings of the various entries, rather than doing a full search – something that could well use changing, if I am indeed correct in thinking that it works that way.