I'm trying to merge room with WorldMap:
but my screen goes black when doing a scan,
First: i load world map
arWorldTrackingConfig.initialWorldMap = worldMap
//arWorldTrackingConfig.planeDetection = [.horizontal, .vertical]
arSession.run(arWorldTrackingConfig)
if #available(iOS 17.0, *) {
roomCaptureView = RoomCaptureView(frame: view.bounds, arSession: arSession)
}
else{
roomCaptureView = RoomCaptureView(frame: view.bounds)
}
roomCaptureView = RoomCaptureView(frame: view.bounds)
roomCaptureView.captureSession.delegate = self
roomCaptureView.delegate = self
view.insertSubview(roomCaptureView, at: 0)
and save when scan done:
roomCaptureView?.captureSession.arSession.getCurrentWorldMap { worldMapData, error in
if let error = error {
return
}
if let worldMap = worldMapData {
let fileURL = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent("worldMapData")
do {
let data = try NSKeyedArchiver.archivedData(withRootObject: worldMap, requiringSecureCoding: true)
try data.write(to: fileURL)
} catch {
print("error ARWorldMap: \(error.localizedDescription)")
}
}
}
the first scan is fine, but the next time, when the worldMap is saved and loaded, my screen goes black,
does anyone have a solution or sample code??
-thank-
Post
Replies
Boosts
Views
Activity
im try load ARWorldMap roomCaptureView?.captureSession.arSession.run(arWorldTrackingConfig, options: []), but when i load ARWorldMap, RoomPlan not work, the screen goes black, and nothing is displayed,
Does anyone know the cause and solution?
i want to test MultiRoom, but i can't make it, can someone give me solution or example app
The position of the wall is represented by transform: simd_float4x4, how a know start point and end point of wall
RoomCaptureView can export data to USDZ file, but i need file output is gltF, any sulution,