I'm using ARKit and trying to get the position of the camera as a rotation and (x,y,z) coordinates in real world space. All I can manage to get is a matrix_float4x4
, which I don't really understand, and euler angles only show the rotation.
Here's what I currently have:
let transform = sceneView.session.currentFrame?.camera.transform
let eulerAngles = sceneView.session.currentFrame?.camera.eulerAngles
Here's the output I'm getting:
eulerAngles: float3(-0.694798, -0.0866041, -1.68845)
transform: __C.simd_float4x4(columns: (float4(-0.171935, -0.762872, 0.623269, 0.0), float4(0.982865, -0.0901692, 0.160767, 0.0), float4(-0.0664447, 0.640231, 0.765304, 0.0), float4(0.0, 0.0, 0.0, 1.0)))
Is there a way to convert the matrix_4x4
, or is there an easier way to get this information?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…