25 #ifndef INCLUDED_ProjectionMatrixFromFOV_h_GUID_880B5E97_076B_4AB7_2E6E_CC6297F3D85B
26 #define INCLUDED_ProjectionMatrixFromFOV_h_GUID_880B5E97_076B_4AB7_2E6E_CC6297F3D85B
41 template <
typename System>
56 ret[Rectd::RIGHT] = std::tan(
getRadians(hFov / 2.));
57 ret[Rectd::LEFT] = -ret[Rectd::RIGHT];
58 ret[Rectd::TOP] = std::tan(
getRadians(vFov / 2.));
59 ret[Rectd::BOTTOM] = -ret[Rectd::TOP];
65 template <
typename System>
79 template <
typename System>
80 inline Eigen::Matrix4d
94 #endif // INCLUDED_ProjectionMatrixFromFOV_h_GUID_880B5E97_076B_4AB7_2E6E_CC6297F3D85B
The main namespace for all C++ elements of the framework, internal and external.
boost::units::quantity< boost::units::unit< boost::units::plane_angle_dimension, System >, Y > AngleGeneric
Convenience template alias for a plane_angle quantity in an arbitrary system with arbitrary scalar...
Eigen::Matrix4d createSymmetricProjectionMatrix(AngleGeneric< System > hFov, AngleGeneric< System > vFov, double near, double far)
Rectd computeSymmetricFOVRect(AngleGeneric< System > hFov, AngleGeneric< System > vFov)
Compute a rectangle at unit distance for the given fov values.
Eigen::Matrix4d createProjectionMatrix(Rectd const &bounds, double near, double far)
Takes in points at the near clipping plane, as well as the near and far clipping planes. Result matrix maps [l, r] and [b, t] to [-1, 1], and [n, f] to [-1, 1] (should be configurable)
Y getRadians(AngleGeneric< System, Y > const angle)
Get the raw scalar value of your angle in radians.