0
$\begingroup$

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 enter image description here

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 enter image description here

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!

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.