The COORD2TO3 function converts normalized X and Y screen coordinates to 3D data coordinates.
| Note |
This routine is written in the IDL language. Its source code can be found in the file coord2to3.pro in the lib subdirectory of the IDL distribution.
Result = COORD2TO3( Mx, My, Dim, D0 [, PTI] )
Returns a three-element vector containing 3D data coordinates given the normalized X and Y screen coordinates and one of the three data coordinates.
The normalized X and Y screen coordinates.
A parameter used to specify which data coordinate is fixed. Use 0 for a fixed X data coordinate, 1 for a fixed Y data coordinate, or 2 for a fixed Z data coordinate.
The value of the fixed data coordinate.
The inverse of
None.
To return the data coordinates of the mouse, fixing the data Z value at 10, enter the commands:
;Make sure a transformation matrix exists. CREATE_VIEW ;Get the normalized mouse coords. CURSOR, X, Y, /NORM ;Print the 3D coordinates. PRINT, COORD2TO3(X, Y, 2, 10.0)
CONVERT_COORD, CREATE_VIEW, CV_COORD, SCALE3, T3D