Class OrthographicNormalizeMatrix


  • public final class OrthographicNormalizeMatrix
    extends Object
    We use two steps to transform the camera's configurable orthographic view volume into the standard orthographic view volume. The first step translates the camera's view volume so that its center line is the z-axis. The second step scales the translated view volume so that it intersects the image plane, z = -1, with corners (-1, -1, -1) and (+1, +1, -1).

    This matrix translates the camera's view volume so that the translated view volume will be centered on the z-axis.

    
         [ 1  0  0  -(r+l)/2 ]
         [ 0  1  0  -(t+b)/2 ]
         [ 0  0  1      0    ]
         [ 0  0  0      1    ]
       
    This matrix scales the translated view volume so that it will be 2 units wide and 2 units tall at the image plane z = -1.
    
         [ 2/(r-l)    0     0  0 ]
         [   0     2/(t-b)  0  0 ]
         [   0        0     1  0 ]
         [   0        0     0  1 ]
       
    The matrix product looks like this.
    
         [ 1  0  0  -(r+l)/2 ]   [ 2/(r-l)    0     0  0 ]
         [ 0  1  0  -(t+b)/2 ] = [   0     2/(t-b)  0  0 ]
         [ 0  0  1      0    ]   [   0        0     1  0 ]
         [ 0  0  0      1    ]   [   0        0     0  1 ]
    
              [ 2/(r-l)    0    0  -(r+l)/2 ]
            = [   0     2/(t-b) 0  -(t+b)/2 ]
              [   0        0    1      0    ]
              [   0        0    0      1    ]
       
    This product matrix transforms the camera's configurable orthographic view volume into the standard normalized orthographic view volume whose intersection with the image plane, z = -1, has left = -1, right = +1, bottom = -1, and top = +1.
    • Method Detail

      • build

        public static Matrix build​(double l,
                                   double r,
                                   double b,
                                   double t)
        This is a static factory method.

        Construct the Matrix that transforms from the Camera's orthographic view coordinate system to the normalized orthographic camera coordinate system.

        Parameters:
        l - left edge of view rectangle
        r - right edge of view rectangle
        b - bottom edge of view rectangle
        t - top edge of view rectangle
        Returns:
        a new Matrix object containing the orthographic normalization matrix