Post

Replies

Boosts

Views

Activity

Reply to Rotate object to look at camera using Realitykit Look(at) is broken
I am back with the final solution! The method above does work if you would like a floating pointer in front of your camera to show direction to an entity in scene, but, it is glitchy and if your hand's shaking slightly the pointer will also shake slightly because of the slight delay of getting the camera position and moving your pointer relative to that position! The improved method, which work like a charm, is to create a custom placeholder entity that conforms to hasAnchoring, and has no children, no model, just a placeholder. You call the look(at) method on this placeholder entity which won't consume much processing power since it is empty. It will move the object and orients it correctly. Now, you get the orientation of this placeholder entity, apply to your real pointer, which is a child of an AnchorEntity anchored to camera, and set its orientation with respect to world coordinate. Boom! It worked! no more shaking! Don't forget to offset the pointer so it is in front of the camera. A little bit of code for those came across this post in the future:  pointer.setOrientation(placeHolder.orientation, relativeTo: nil)
Aug ’20
Reply to Best practices for loading AR anchors on a loaded ARWorldMap
I have been playing around with Saving ARWorldmap using realitykit as well but I am having trouble loading the scene back to what it was after saving it. All anchors restored correctly but my AnchorEntity always appear to be at the wrong location. You got any hint on that? I am using the session didadd for adding new Anchorentity to scene when a new ARAnchor was added using my handletap function.
Jun ’20