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

mapw Subroutine

Purpose

Computes the inverse mapping from screen coordinates to modeling coordinates.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

void mapw
(Int32 viewobj, 
Screencoord screenx, Screencoord screeny, 
Coord *modelx1, Coord *modely1, Coord *modelz1, 
Coord *modelx2, Coord *modely2, Coord * modelz2)

FORTRAN Syntax

SUBROUTINE MAPW(viewobj, screenx, screeny, modelx1, modely1, modelz1, modelx2, modely2, modelz2)

INTEGER*4 viewobj, screenx, screeny

REAL modelx1, modely1, modelz1, modelx2, modely2, modelz2

Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.

Description

The mapw subroutine takes a pair of 2-D screen coordinates and maps them into 3-D modeling coordinates. Because the z coordinate is missing from the screen coordinate system, the point becomes a line in modeling space. The mapw subroutine computes the inverse mapping from the viewing object.

The system returns a modeling coordinate line, which is computed from the (screenx, screeny) parameters and the viewobj parameter as two points and stored in the locations addressed by the modelx1, modely1, modelz1 parameters and the modelx2, modely2, modelz2 parameters.

Note: This subroutine cannot be used to add to a display list.

Parameters

viewobj Specifies a viewing object containing the transformations that map the current displayed objects to the screen.
screenx Specifies the x coordinate of the screen point to be mapped.
screeny Specifies the y coordinate of the screen point to be mapped.
modelx1 Specifies the x model coordinate of one endpoint of a line.
modely1 Specifies the y model coordinate of one endpoint of a line.
modelz1 Specifies the z model coordinate of one endpoint of a line.
modelx2 Specifies the x model coordinate of the remaining endpoint of a line.
modely2 Specifies the y model coordinate of the remaining endpoint of a line.
modelz2 Specifies the z model coordinate of the remaining endpoint of a line.

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

Creating a new object in the display list with the makeobj subroutine.

Computing the inverse mapping from screen coordinates to 2-D modeling coordinates with the mapw2 subroutine.

AIX Graphics Library Overview, Picking and Selecting Overview, and Working with Coordinate Systems.


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