# computing sheared perspective projection matrix

is it possible to calculate a "projection matrix" which is sheared as well? the usual perspective projection matrix forms a pyramid where the near clipping plane is rectangular. I have 4 lines which represents the edges of the pyramid in general. But the clipping plane is not orthogonal to the view direction (see picture 1)

Picture 1: view onto the projected area from above. Also from the side direction it will look like this

By looking from the view position to the near clipping plane / image plane it would look like picture 2.

Picture 2: the view from the view position onto the scene

The image plane is restricted to be rectangular. Only from the view position its shape will look non rectangular.

Now lets look at the parameters which are known:

1. all 4 corners of the image plane
2. the view position
3. the far plane distance

so my task is to calculate this projection matrix, but I've no idea how to start or if it is possible at all. Thanks for your help in advance!

• In a vertex shader, after multiplying with the view matrix, divide z by y. And scale appropriately. Jan 29, 2021 at 19:24
• @andrewWilson can you discribe how your solution works? I don't get it... But thanks a lot for your help! Jan 30, 2021 at 11:44
• In depth discussion on oblique clipping planes: terathon.com/lengyel/Lengyel-Oblique.pdf Jan 30, 2021 at 11:51