Package renderer.scene
Class OrthographicNormalizeMatrix
- java.lang.Object
-
- renderer.scene.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.
This matrix scales the translated view volume so that it will be 2 units wide and 2 units tall at the image plane[ 1 0 0 -(r+l)/2 ] [ 0 1 0 -(t+b)/2 ] [ 0 0 1 0 ] [ 0 0 0 1 ]
z = -1
.
The matrix product looks like this.[ 2/(r-l) 0 0 0 ] [ 0 2/(t-b) 0 0 ] [ 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,[ 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 ]
z = -1
, hasleft = -1
,right = +1
,bottom = -1
, andtop = +1
.
-
-
Constructor Summary
Constructors Constructor Description OrthographicNormalizeMatrix()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Matrix
build(double l, double r, double b, double t)
This is a static factory method.
-
-
-
Constructor Detail
-
OrthographicNormalizeMatrix
public OrthographicNormalizeMatrix()
-
-
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 theCamera
's orthographic view coordinate system to the normalized orthographic camera coordinate system.- Parameters:
l
- left edge of view rectangler
- right edge of view rectangleb
- bottom edge of view rectanglet
- top edge of view rectangle- Returns:
- a new
Matrix
object containing the orthographic normalization matrix
-
-