Defines an orthographic transformation.

FORTRAN (**libfgl.a**)

void ortho(Coordleft, Coordright,Coordbottom, Coordtop,Coordnear, Coordfar)

void ortho2(Coordleft,Coordright,Coordbottom, Coordtop)

SUBROUTINE ORTHO(left,right,bottom,top,near,far)REALleft,right,bottom,top,near,far

SUBROUTINE ORTHO2(left,right,bottom,top)REALleft,right,bottom,top

The foregoing routines are functionally the same. They differ only in that the **ortho** subroutine is used for 3-D applications and the **ortho2** subroutine is used for 2-D applications.

The **ortho **and **ortho2 **subroutines set the current projection transformation to be an orthographic perspective transformation. With an orthographic projection, figures do not get smaller as they recede in relation to the viewer. Orthographic projections also preserve angles.

The **ortho** subroutine specifies a box-shaped enclosure in the eye coordinate system that is mapped to the
viewport. The *left*, *right*, *bottom*, *top* parameters are the *x *and *y *
*clipping planes**. *The *near* and *far* parameters are distances along the line of sight from the eye screen origin, and can be negative. The *z *clipping planes are at *-near* and *-far*.

The **ortho2** subroutine defines a 2-D clipping rectangle. When you use this subroutine with 3-D
modeling coordinates, the *z* values are not transformed. Objects with z values outside the range **-**1 <=* z *<=1 are clipped out.

When the system is in single matrix mode, both the **ortho **and **ortho2 **subroutines load a matrix onto the
matrix stack, thus replacing the current top matrix. When the system is in
viewing matrix mode or
projection matrix mode, it replaces the current projection matrix without changing the matrix stack.

To be more technically accurate, the **ortho** and **ortho2** subroutines set the mapping from eye coordinates to normalized device coordinates
(NDC). Clipping occurs in NDC; all drawing primitives (except for text and
blits) are clipped to -w <= x, y, z <= +w. The map is such that the clipping plane -w=x (in NDC) appears to be at +w*left = x in eye coordinates, and so on for the other five sides. For most drawing primitives, w=1.

After the **ortho** subroutine completes, the eye coordinate system is set up so that x is to the right, y is up, and z is towards the viewer (out of the screen).

- The example C language program
**paint.c**uses the**ortho2**subroutine to define the two-dimensional world coordinates that exactly fit the defined viewport. - The example C language program
**backface.c**uses the**ortho**subroutine to map a rectangular volume of space to the viewport.

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

/usr/include/gl/gl.h |
Contains C language constant and variable type definitions for GL. |

/usr/include/gl/fgl.h |
Contains FORTRAN constant and variable type definitions for GL. |

Setting the current matrix mode with the **mmode** subroutine.

Defining a perspective projection transformation in terms of a field of view with the **perspective** subroutine.

Defining a perspective projection transformation in terms of *x* and *y* coordinates with the **window** subroutine.

AIX Graphics Library Overview and Working with Coordinate Systems.