Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Modify the far plane corners of the frustum

Discussion in 'General Graphics' started by LionelTC, Mar 9, 2020.

  1. LionelTC

    LionelTC

    Joined:
    Oct 14, 2019
    Posts:
    6
    Hi,

    I am making an application that requires collocation between the motion of an object in the physical world and it's virtual counterpart in the Unity world.

    In my physical setup, user has to look at the monitor from an angle (i.e. the line between the user's nose to the center of the screen is not perpendicular to the screen surface). But in unity, the scene is projected to the camera as if the user is look at the screen without an angle.

    My first attempt to solve this is to change the corner position of the near plane of the frustum by using Matrix4x4.Frustum() function. This didn't work out because the the normal vector of the near plane that passes through the camera won't pass through the center of the near plane anymore.

    To solve this, I would like to keep the corner of the near plane unchanged and modify that of the far plane. In this manner, I should still be able to create the oblique projection while keep the normal vector of the near plane passing through both the camera and the center of the near plane (i.e. the center of the physical screen).

    Is there a way to modify the corner of the far plane of the frustum, or maybe there is even a better way to achieve the oblique projection?
     
  2. Fenikkel

    Fenikkel

    Joined:
    Sep 24, 2019
    Posts:
    20