XLua2 API Ref XPLMGraphics Latest - 4.4.0-d4

X-Plane Coordinates

These routines allow you to use OpenGL with X-Plane.


XPLMWorldToLocal

function

This routine translates coordinates from latitude, longitude, and altitude to local scene coordinates. Latitude and longitude are in decimal degrees, and altitude is in meters MSL (mean sea level). The XYZ coordinates are in meters in the local OpenGL coordinate system.

XPLMWorldToLocal(
    inLatitude,     -- float
    inLongitude,    -- float
    inAltitude,     -- float
    outX,           -- float
    outY,           -- float
    outZ            -- float
)

XPLMLocalToWorld

function

This routine translates a local coordinate triplet back into latitude, longitude, and altitude. Latitude and longitude are in decimal degrees, and altitude is in meters MSL (mean sea level). The XYZ coordinates are in meters in the local OpenGL coordinate system.

NOTE: world coordinates are less precise than local coordinates; you should try to avoid round tripping from local to world and back.

XPLMLocalToWorld(
    inX,             -- float
    inY,             -- float
    inZ,             -- float
    outLatitude,     -- float
    outLongitude,    -- float
    outAltitude      -- float
)