Purpose
Returns properties of a 3DMap window. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
Map3DInfo( window_id, attribute )
window_id is an integer window identifier.
attribute is an integer code, indicating which type of information should be returned.
Return Value
Float, logical, or string, depending on the attribute parameter.
Description
The Map3DInfo() function returns information about a 3DMap window.
The window_id parameter specifies which 3DMap window to query. To obtain a window identifier, call the FrontWindow() function immediately after opening a window, or call the WindowID() function at any time after the window's creation.
There are several numeric attributes that Map3DInfo() can return about any given 3DMap window. The attribute parameter tells the Map3DInfo() function which Map window statistic to return. The attribute parameter should be one of the codes from the following table; codes are defined in MAPBASIC.DEF.
Attribute | ID | Return Value |
---|---|---|
MAP3D_INFO_SCALE | 1 | Float result representing the 3DMaps scale factor. |
MAP3D_INFO_RESOLUTION_X | 2 | Integer result representing the X resolution of the grid(s) in the 3DMap window. |
MAP3D_INFO_RESOLUTION_Y | 3 | Integer result representing the Y resolution of the grid(s) in the 3DMap window. |
MAP3D_INFO_BACKGROUND | 4 | Integer result representing the background color, see the RGB function. |
MAP3D_INFO_UNITS | 5 | String representing the map's abbreviated area unit name, for example, "mi" for miles. |
MAP3D_INFO_LIGHT_X | 6 | Float result representing the x-coordinate of the Light in the scene. |
MAP3D_INFO_LIGHT_Y | 7 | Float result representing the y-coordinate of the Light in the scene. |
MAP3D_INFO_LIGHT_Z | 8 | Float result representing the z-coordinate of the Light in the scene. |
MAP3D_INFO_LIGHT_COLOR | 9 | Integer result representing the Light color, see RGB() function. |
MAP3D_INFO_CAMERA_X | 10 | Float result representing the x-coordinate of the Camera in the scene. |
MAP3D_INFO_CAMERA_Y | 11 | Float result representing the y-coordinate of the Camera in the scene. |
MAP3D_INFO_CAMERA_Z | 12 | Float result representing the z-coordinate of the Camera in the scene. |
MAP3D_INFO_CAMERA_FOCAL_X | 13 | Float result representing the x-coordinate of the Cameras FocalPoint in the scene. |
MAP3D_INFO_CAMERA_FOCAL_Y | 14 | Float result representing the y-coordinate of the Cameras FocalPoint in the scene. |
MAP3D_INFO_CAMERA_FOCAL_Z | 15 | Float result representing the z-coordinate of the Cameras FocalPoint in the scene. |
MAP3D_INFO_CAMERA_VU_1 | 16 | Float result representing the first value of the ViewUp Unit Normal Vector. |
MAP3D_INFO_CAMERA_VU_2 | 17 | Float result representing the second value of the ViewUp Unit Normal Vector. |
MAP3D_INFO_CAMERA_VU_3 | 18 | Float result representing the third value of the ViewUp Unit Normal Vector. |
MAP3D_INFO_CAMERA_VPN_1 | 19 | Float result representing the first value of the ViewPlane Unit Normal Vector. |
MAP3D_INFO_CAMERA_VPN_2 | 20 | Float result representing the second value of the ViewPlane Unit Normal Vector. |
MAP3D_INFO_CAMERA_VPN_3 | 21 | Float result representing the third value of the ViewPlane Unit Normal Vector. |
MAP3D_INFO_CAMERA_CLIP_NEAR | 22 | Float result representing the cameras near clipping plane. |
MAP3D_INFO_CAMERA_CLIP_FAR | 23 | Float result representing the cameras far clipping plane. |
Example
Prints out all the state variables specific to the 3DMap window:
include "Mapbasic.def"
Print "MAP3D_INFO_SCALE: " + Map3DInfo(FrontWindow(), MAP3D_INFO_SCALE)
Print "MAP3D_INFO_RESOLUTION_X: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_RESOLUTION_X)
Print "MAP3D_INFO_RESOLUTION_Y: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_RESOLUTION_Y)
Print "MAP3D_INFO_BACKGROUND: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_BACKGROUND)
Print "MAP3D_INFO_UNITS: " + Map3DInfo(FrontWindow(), MAP3D_INFO_UNITS)
Print "MAP3D_INFO_LIGHT_X : " + Map3DInfo(FrontWindow(),
MAP3D_INFO_LIGHT_X )
Print "MAP3D_INFO_LIGHT_Y : " + Map3DInfo(FrontWindow(),
MAP3D_INFO_LIGHT_Y )
Print "MAP3D_INFO_LIGHT_Z: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_LIGHT_Z)
Print "MAP3D_INFO_LIGHT_COLOR: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_LIGHT_COLOR)
Print "MAP3D_INFO_CAMERA_X: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_X)
Print "MAP3D_INFO_CAMERA_Y : " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_Y )
Print "MAP3D_INFO_CAMERA_Z : " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_Z )
Print "MAP3D_INFO_CAMERA_FOCAL_X: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_FOCAL_X)
Print "MAP3D_INFO_CAMERA_FOCAL_Y: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_FOCAL_Y)
Print "MAP3D_INFO_CAMERA_FOCAL_Z: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_FOCAL_Z)
Print "MAP3D_INFO_CAMERA_VU_1: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VU_1)
Print "MAP3D_INFO_CAMERA_VU_2: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VU_2)
Print "MAP3D_INFO_CAMERA_VU_3: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VU_3)
Print "MAP3D_INFO_CAMERA_VPN_1: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VPN_1)
Print "MAP3D_INFO_CAMERA_VPN_2: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VPN_2)
Print "MAP3D_INFO_CAMERA_VPN_3: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_VPN_3)
Print "MAP3D_INFO_CAMERA_CLIP_NEAR: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_CLIP_NEAR)
Print "MAP3D_INFO_CAMERA_CLIP_FAR: " + Map3DInfo(FrontWindow(),
MAP3D_INFO_CAMERA_CLIP_FAR)
See Also:
Create Map3D statement, Set Map3D statement