【发布时间】:2019-09-30 14:32:27
【问题描述】:
我从文档中了解到,ARKit 是CoreMotion plus AVFoundation,但是我是如何获取传感器数据的:
- 重力
- 加速
- 旋转矩阵
那个 CoreMotion 是从 ARKit 提供的,而不是设置一个 Core Motion 的监听器?
【问题讨论】:
标签: ios swift augmented-reality arkit sensors
我从文档中了解到,ARKit 是CoreMotion plus AVFoundation,但是我是如何获取传感器数据的:
那个 CoreMotion 是从 ARKit 提供的,而不是设置一个 Core Motion 的监听器?
【问题讨论】:
标签: ios swift augmented-reality arkit sensors
ARKit(及其新的卫星RealityKit)不仅包含来自CoreMotion和AVFoundation框架的一些类、方法和属性,还包含一些类、方法和属性来自:
但是,您无法从 iPhone 传感器获取任何原始数据(Apple 不允许),但您绝对可以使用允许访问的数据。
例如:
1.一个像素缓冲区,其中包含相机捕获的图像:
let pixelBuffer: CVPixelBuffer? = sceneView.session.currentFrame?.capturedImage
2.相机在世界坐标空间中的位置和方向(simd_float4x4):
let cameraMatrix = (sceneView.session.currentFrame?.camera.transform)!
3. ARKit 如何根据真实世界的设备运动构造场景坐标系的选项:
ARConfiguration.WorldAlignment.gravityAndHeading
ARConfiguration.WorldAlignment.gravity
ARConfiguration.WorldAlignment.camera
唉,但你无法从 IMU 获得纯加速度数据。
【讨论】: