Computes the inverse mapping from screen coordinates to modeling coordinates.

FORTRAN (**libfgl.a**)

void mapw(Int32viewobj,Screencoordscreenx, Screencoordscreeny,Coord *modelx1, Coord *modely1, Coord *modelz1,Coord *modelx2, Coord *modely2, Coord *modelz2)

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

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.

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

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

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.