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

translate Subroutine

Purpose

Translates graphical primitives.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void translate(Coord x, Coord y, Coord z)

FORTRAN Syntax

SUBROUTINE TRANSL(x, y, z)
REAL x, y, z

Description

The translate subroutine moves the modeling space origin to a new point relative to the current origin. The point (x, y, z) specified by the parameters becomes the new modeling space origin. Because all drawing primitives draw relative to the origin of the current modeling coordinate system, all primitives called after this subroutine will appear to have been translated.

The translate subroutine is a modeling routine that changes the current transformation matrix. All primitives drawn after this subroutine executes are translated. Use the pushmatrix and popmatrix subroutines to preserve an untranslated modeling space.

Parameters

x Specifies the x coordinate of a point in modeling coordinates.
y Specifies the y coordinate of a point in modeling coordinates.
z Specifies the z coordinate of a point in modeling coordinates.

Example

The example C language program backface.c uses the translate modeling subroutine and alters the current transformation matrix to model the sides of a cube using a square.

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

Popping the transformation matrix stack with the popmatrix subroutine.

Pushing down the transformation matrix stack with the pushmatrix subroutine.

Rotating a graphical primitive (floating-point version) with the rot subroutine.

Rotating a graphical primitive (fixed-point version) with the rotate subroutine.

Scaling and mirroring objects with the scale subroutine.

AIX Graphics Library Overview and Working with Coordinate Systems.


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