Class ProjectionMatrix


  • public class ProjectionMatrix
    extends java.lang.Object
    projection matrix
    • Constructor Detail

      • ProjectionMatrix

        public ProjectionMatrix​(long cPtr,
                                boolean cMemoryOwn)
      • ProjectionMatrix

        public ProjectionMatrix()
        constructor
    • Method Detail

      • delete

        public void delete()
      • e

        public EigenMatrix4d e()
        get the boost matrix corresponding to this projection
      • isPerspectiveProjection

        public boolean isPerspectiveProjection()
        test if this is a perspective projection
      • isOrtographicProjection

        public boolean isOrtographicProjection()
        test if this is a ortographic projection
      • setOrtho

        public void setOrtho​(double left,
                             double right,
                             double bottom,
                             double top,
                             double zNear,
                             double zFar)
        set the projection matrix to an ortographic projection by defining
        the box with length to all sides (left, right, bottom, top, near and far)
        Parameters:
        left - [in] length in m to left edge of image
        right - [in] length in m to right edge of image
        bottom - [in] length in m to bottom edge of image
        top - [in] length in m to top edge of image
        zNear - [in] length in m to near clipping plane
        zFar - [in] length in m to far clipping plane
      • setFrustum

        public void setFrustum​(double left,
                               double right,
                               double bottom,
                               double top,
                               double zNear,
                               double zFar)
        set the projection matrix to the viewing frustum
        Parameters:
        left - [in] distance in m near cutting plane from center to left edge
        right - [in] distance in m near cutting plane from center to right edge
        bottom - [in] distance in m near cutting plane from center to bottom edge
        top - [in] distance in m near cutting plane from center to top edge
        zNear - [in] distance in m along z-axis to near cutting plane
        zFar - [in] distance in m along z-axis to far cutting plane
      • getFrustum

        public boolean getFrustum​(SWIGTYPE_p_double left,
                                  SWIGTYPE_p_double right,
                                  SWIGTYPE_p_double bottom,
                                  SWIGTYPE_p_double top,
                                  SWIGTYPE_p_double zNear,
                                  SWIGTYPE_p_double zFar)
        get the projection matrix to the viewing frustum
        Parameters:
        left - [out] distance in m near cutting plane from center to left edge
        right - [out] distance in m near cutting plane from center to right edge
        bottom - [out] distance in m near cutting plane from center to bottom edge
        top - [out] distance in m near cutting plane from center to top edge
        zNear - [out] distance in m along z-axis to near cutting plane
        zFar - [out] distance in m along z-axis to far cutting plane
      • setPerspective

        public void setPerspective​(double fovy,
                                   double aspectRatio,
                                   double zNear,
                                   double zFar)
        set the projection matrix to perspective projection
        Parameters:
        fovy - [in] vertical field of view [degrees]
        aspectRatio - [in] aspect ratio between width and height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
      • setPerspective

        public void setPerspective​(double fovy,
                                   double width,
                                   double height,
                                   double zNear,
                                   double zFar)
        set the projection matrix to perspective projection
        Parameters:
        fovy - [in] vertical field of view [degrees]
        width - [in] width of image
        height - [in] height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
      • getPerspective

        public boolean getPerspective​(SWIGTYPE_p_double fovy,
                                      SWIGTYPE_p_double aspectRatio,
                                      SWIGTYPE_p_double zNear,
                                      SWIGTYPE_p_double zFar)
        get the projection matrix to perspective projection
        Parameters:
        fovy - [in] vertical field of view [degrees]
        aspectRatio - [in] aspect ratio between width and height of image
        zNear - [in] distance to near cutting plane
        zFar - [in] distance to far cutting plane
        Returns:
        is it succesfull
      • makePerspective

        public static ProjectionMatrix makePerspective​(double fovy,
                                                       double aspectRatio,
                                                       double zNear,
                                                       double zFar)
        creates a projection matrix with a perspective projection
        Parameters:
        fovy -
        aspectRatio -
        zNear -
        zFar -
        Returns:
        new ProjectionMatrix.
      • makePerspective

        public static ProjectionMatrix makePerspective​(double fovy,
                                                       double width,
                                                       double height,
                                                       double zNear,
                                                       double zFar)
        creates a projection matrix with a perspective projection
        Parameters:
        fovy - [in]
        width - [in] of image
        height - [in] of image
        zNear - [in]
        zFar - [in]
        Returns:
        new ProjectionMatrix.
      • makeOrtho

        public static ProjectionMatrix makeOrtho​(double left,
                                                 double right,
                                                 double bottom,
                                                 double top,
                                                 double zNear,
                                                 double zFar)
        creates a projection matrix with a orthographic projection
        Parameters:
        left -
        right -
        bottom -
        top -
        zNear -
        zFar -
        Returns:
        new ProjectionMatrix.
      • getClipPlanes

        public pair_d_d getClipPlanes()
        get near and far clipping plane
        Returns: