Jump to content

Recommended Posts

Posted

Working on a project, and trying to get lat lon of the camera via lua exports. 

I found `LoGetCameraPosition()` and that is good; however, it exports position as meters relative to an origin lat/lon. Is there a simple and clean way to get camera positoin in lat lon without offsetting from a starting point and adding meters then converting back to lat/long (especially since DCS is a flat world and most calculations use WSG84 when adding meters to a GPS location)

Thanks in advance

Posted

Update: Found the answer if anyone ever needs it:
 

    local camPos = LoGetCameraPosition()
    local position = camPos["p"]
    local x = position["x"]
    local z = position["z"]

    local coords = LoLoCoordinatesToGeoCoordinates(x,z);
    log.write("exportTest", log.INFO, coords["latitude"].." "..coords["longitude"])

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...