【发布时间】:2021-08-03 20:22:20
【问题描述】:
由于激光雷达已内置于 2020+ 最新的 iOS 设备(iPhone 12 Pro、iPad Pro)中。
ARKit 拥有比以往更多的可能性,包括支持导出到 .obj。
这里是将ARReferenceObject导出到.arobject的代码
guard let testRun = self.testRun,
let object = testRun.referenceObject,
let name = object.name
else {
print("Error: Missing scanned object.")
return
}
let documentURL = FileManager.default.temporaryDirectory
.appendingPathComponent(name + ".arobject")
DispatchQueue.global().async {
do {
try object.export(to: documentURL,
previewImage: testRun.previewImage)
} catch {
fatalError("Failed to save the file to \(documentURL)")
}
}
如何导出为.obj?
【问题讨论】:
标签: swift augmented-reality arkit realitykit lidar