Matrix4d.projViewFromRectangle

Create a view and projection matrix from a given <code>eye</code> position, a given bottom left corner position <code>p</code> of the near plane rectangle and the extents of the near plane rectangle along its local <code>x</code> and <code>y</code> axes, and store the resulting matrices in <code>projDest</code> and <code>viewDest</code>. <p> This method creates a view and perspective projection matrix assuming that there is a pinhole camera at position <code>eye</code> projecting the scene onto the near plane defined by the rectangle. <p> All positions and lengths are in the same (world) unit.

@param eye the position of the camera @param p the bottom left corner of the near plane rectangle (will map to the bottom left corner in window coordinates) @param x the direction and length of the local "bottom/top" X axis/side of the near plane rectangle @param y the direction and length of the local "left/right" Y axis/side of the near plane rectangle @param nearFarDist the distance between the far and near plane (the near plane will be calculated by this method). If the special value {@link Double#POSITIVE_INFINITY} is used, the far clipping plane will be at positive infinity. If the special value {@link Double#NEGATIVE_INFINITY} is used, the near and far planes will be swapped and the near clipping plane will be at positive infinity. If a negative value is used (except for {@link Double#NEGATIVE_INFINITY}) the near and far planes will be swapped @param zeroToOne whether to use Vulkan's and Direct3D's NDC z range of <code>[0..+1]</code> when <code>true</code> or whether to use OpenGL's NDC z range of <code>[-1..+1]</code> when <code>false</code> @param projDest will hold the resulting projection matrix @param viewDest will hold the resulting view matrix

struct Matrix4d
public static
void
projViewFromRectangle

Meta