1

我正在使用 JSON 格式从 Google Earth Studio 中导出数据。我想将此数据导入 3D 应用程序,如 maya 或 houdini。我的问题是关于相机方向的。我似乎无法将我在 JSON 文件中看到的相机 xyz 旋转数据与我在 Google Earth Studio 中设置的云台值关联起来。例如从界面,这里是相机设置:

cam lon= 0
cam lat= 33.9165151812 
cam alt = 1725 m
cam pan = 0  (looking straight)
cam tilt = 0 (pointing nadir)

这变成了以下旋转向量:

rx=180 | ry=-56.0834848188 | rz=-89.9999999998

注意我正在使用 python 来解释这些数据。理想情况下,我想对这些 rx,ry,rz 角度进行逆向工程,以获取我可以在我的 3d 软件中使用的平移/倾斜/滚动值。

您可能有任何提示将不胜感激。以下是我到目前为止所做的概述:

lat = camdata["cameraFrames"][f]["coordinate"]["latitude"]
lon = camdata["cameraFrames"][f]["coordinate"]["longitude"]
alt = camdata["cameraFrames"][f]["coordinate"]["altitude"]

xEcef,yEcef,zEcef = geodetic_to_ecef(lat, lon, alt)  # get earth-centered, earth-fixed coords
xEast, yNorth, zUp = ecef_to_enu(xEcef,yEcef,zEcef,lat0,lon0,alt0) # get local east, north up coords relative to a reference lat0,lon0,alt0

 # express in y-up coords
 txmod = xEast
 tzmod = -yNorth
 tymod = zUp

 rx = camdata["cameraFrames"][f]["rotation"]["x"]
 ry = camdata["cameraFrames"][f]["rotation"]["y"] 
 rz = camdata["cameraFrames"][f]["rotation"]["z"]

 # now I have to use these rotations in conjunction with the camera's lat,lon, alt
 # to get back pan/tilt/roll values
4

0 回答 0