Creating an Oblique Camera

How feasible would it be to create a camera that produces an “oblique projection”?

To explain, I’m considering a reworking of the way in which I’m handling the view of a game that I’m working on:

At the moment I’m “faking” an impression of projection via a top-down camera and a world that is variously skewed or tilted, giving the impression of viewing the scene at an angle. But this has its disadvantages, and I’m considering simplifying by, well, actually having the camera view the scene at an angle.

However, if I’m not much mistaken, with a standard orthographic lens this would result in movement on the y-axis being compressed, seeming slower. I think that I’d prefer that movement in all directions appear to be of equal speed (as is currently the case).

Based on some research, this would seem to correspond to an “oblique projection”–something close to “military projection”, but without the 45-degree rotation.

Is there a way of doing that (without impacting performance overmuch)?

1 Like

You could try using the setViewMat method on your camera’s Lens object. Lens — Panda3D Manual. This should allow you to use the matrix (Oblique projection - Wikipedia) Wikipeida lists. I’m not sure how it’ll impact lighting calculations though (they might be wrong).

1 Like

Thankfully I’m not really using traditional lighting, so I suspect that I’ll be fine on that count.

And thank you for the answer! That seems like it should work! :slight_smile:

A custom projection matrix is actually made by using a MatrixLens, this allows you to completely replace the projection matrix.

1 Like

Ah yes, I think that I was thinking of that lens-class when I read the answer above, but as I’m having a bit of a weird day I missed the omission of it.

You are correct, however, that a MatrixLens would be called for I daresay!

Panda3D has a class for everything :joy:

1 Like