Post

Replies

Boosts

Views

Activity

Reply to Create Anchor on Objects from 2D Data
Hi, i am @christiandevin 's teammate. Firstly, we'd like to extend our gratitude for the insightful responses we've received so far—they have been immensely helpful! We also submitted an enhancement request to obtain depth data from cameraFrameProvider, but with the deadline of our project is coming quite soon, we went for the raycasting approach. Current Setup: In our RealityView, we have two root entities: observationRoot: Manages RealityKit's sphere and label entities (of the detected objects) for raycasting. sceneReconstructionRoot: Holds ModelEntity instances obtained from the SceneReconstructionProvider. RealityView { content in content.add(anchorViewModel.observationRoot) content.add(anchorViewModel.sceneReconstrutionRoot) } Transform Configuration: We apply transformations only to the observationRoot as follows: let focalLengthMeters: Float = 0.6 let focalLengthTransform = Transform( translation: SIMD3<Float>(0, 0, focalLengthMeters) ).matrix let finalMatrix = anchorTransform * extrinsics.inverse * focalLengthTransform observationRoot.transform.matrix = finalMatrix . We do not apply any transform to the sceneReconstructionRoot. The Challenge: For successful raycasting, we need to perform raycasts that consider entities from both observationRoot and sceneReconstructionRoot. Ideally, this would require having all relevant entities under a single parent entity. However, transferring entities from sceneReconstructionRoot to observationRoot causes the scene reconstruction entities to inherit and follow the transformations of observationRoot, which disrupts their original positioning and orientation. Question: Is there a way to merge entities from both observationRoot and sceneReconstructionRoot into a single parent entity while maintaining each entity's original transform? We aim to combine these entities for comprehensive raycasting without altering the orientation and position of the scene reconstruction entities. Thank you in Advance! Best regards, Raymond
Topic: Spatial Computing SubTopic: ARKit Tags:
Jan ’25