[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

window Subroutine

Purpose

Defines a perspective projection transformation in terms of x and y coordinates.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void window
(Coord left, Coord right,
Coord bottom, Coord top,
Coord near, Coord far)

FORTRAN Syntax

SUBROUTINE WINDOW(left, right, bottom, top, near, far)
REAL left, right, bottom, top, near, far

Description

The window subroutine set the current projection transformation to be a perspective transformation. With a perspective transformation, figures do not get smaller as they recede in relation to the viewer.

The window subroutine defines a frustum in eye coordinates. All figures outside this frustum are clipped and not drawn on the screen. All objects contained within this frustum are drawn on the screen in perspective.

The front and back of the frustum are the near and far clipping planes, respectively, located at near and far. The sides of the frustum are the projection of a rectangle in the near clipping plane. That is, given a rectangle in the near clipping plane, the sides of the frustum are given by extending from the eye (the origin) through the near clipping plane to the far clipping plane. The sides of the frustum are the left, right, bottom, and top clipping planes. The size of the rectangle on the near clipping plane is given by the parameters left, right, bottom, and top.

The window subroutine is very similar to the perspective subroutine. The only difference between these two is the manner in which the arguments specify the viewing frustum.

After the window 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).

In single matrix mode, the window subroutine loads a matrix onto the matrix stack, replacing the current top matrix. In viewing matrix mode and projection matrix mode, the system replaces the current projection matrix.

Note: Do not confuse the window subroutine and its functions with the GL windowing subroutines, and the Enhanced X-Windows subroutines, which control the placement and size of rectangular windows on the screen.

Parameters

left Specifies the x coordinate of left side of frustum.
right Specifies the x coordinate of right side of frustum.
bottom Specifies the y coordinate of bottom of frustum.
top Specifies the y coordinate of top of frustum.
near Specifies the z coordinate of the near clipping plane.
far Specifies the z coordinate of the far clipping plane.

Implementation Specifics

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

Files

/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.

Related Information

Defining a 3-D orthographic transformation with the ortho subroutine.

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

Setting the area of the window used for all drawing with the viewport subroutine.

AIX Graphics Library Overview and Working with Coordinate Systems.


[ Previous | Next | Contents | Glossary | Home | Search ]