1

I'm exporting data out of Google Earth Studio using the JSON format. I would like to import this data into a 3D app, like maya or houdini. The question I have is specifically about camera orientation. I can't seem to corelate the camera xyz rotation data I see in the JSON file to the pan tilt values that I set in Google Earth Studio. For instance from the interface, here are the camera settings:

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

That gets turned into the following rotation vector:

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

Note I'm using python do interpret this data. Ideally, I'd like to reverse-engineer these rx,ry,rz angles to get back pan/tilt/roll values that I can then use in my 3d software.

Any tips you might have would be appreciated. Below is an outline of what I've done so far:

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
Plutovman
  • 677
  • 5
  • 22
  • In Maya, set the rotateAxes on the camera to (0, 0, -90). That Euler rotation should then just work. – robthebloke Aug 11 '21 at 03:15
  • Unfortunately, I don't think it's as simple as that. These euler values are the result of moving the camera to a particular point on the earth (lat,lon) and then rotated locally by some pan/tilt. I think removing the contribution of lat/lon is a good start. I just don't know how to do that. – Plutovman Aug 12 '21 at 09:14
  • Uhm. The data you posted describes a rotation of: 33.9165151812 around lat, 0 around long. The resulting Euler rotation values describe a camera that is using the Z axes for up, and is orientated down the Y axes. Maya is typically Y up, so a quick local rotation of 90 degrees fixes that offset. It's not that useful to talk about transformations that don't exist. I can only talk about what you posted above, which is solved by -90 in the rotateAxes. I'm literally looking at the values on a camera in Maya. – robthebloke Aug 13 '21 at 00:10

0 Answers0