Posts

Post marked as solved
5 Replies
4.7k Views
I am playing around in Realitykit and would like an Entity to always look at camera. I've seen similar questions on stackoverflow and developer forums and followed their suggestion to use look(at) method. I am aware that reality composer can achieve the same effect using behavior but I would later have to use the same technique to anchor an Arrow to the camera using AnchorEntity and have it look at another entity in the scene for user navigation. I am using look(at) method to orient the entity to the camera right now by calling it in ARKit session Didupdate method, however, it is broken:   entity.look(at: arView.cameraTransform.translation, from: entity.position, upVector: [0,0,0], relativeTo: nil) This will move my entity to a new position in the scene and since it is called at ARKit session Didupdate it will keep moving further and further away every frame. I thought it is not supposed to move since I've set the "from:" to object's current position so it always move to where it was and hence static. My entity is an AnchorEntity that act as a root entity for the model loaded from reality composer.
Posted
by Mokin.
Last updated
.
Post not yet marked as solved
2 Replies
1.5k Views
I am trying to use ARWorldmap to save and load the data to relocalize the scene. The example I used was from apple's documentation: https://developer.apple.com/documentation/arkit/world_tracking/saving_and_loading_world_data However, this example uses scenekit to render, and I want to use realitykit. In the example, they use: Scenekit renderer didAdd to render everytime a new anchor has been added. What I did was to swap out the scenekit in the example and replace the method above with ARsession's didAdd Anchors and create a new anchorentity from the anchor added. The app runs with no problem until I tried to load the saved world data. The anchor restored with no problem at all with the correct coordinate. ARsession's didAdd Anchors function was called and it recreates my AnchorEntity at the anchor location. However, my anchorentity created in the didAdd anchors method is at the wrong location as they randomly drifted from where they were supposed to be. Anyone has any clue on how to solve this?
Posted
by Mokin.
Last updated
.
Post not yet marked as solved
2 Replies
505 Views
The reality kit starter project offered in xcode uses around 50-55 percent of the CPU in official iOS 14.1. However, the cpu usage of the same starter project, which contains no custom code or object entity, just an ARView, uses 90-105 percent of the CPU Usage in official iOS 14.2. I've tested it out on multiple iPhone 11 Pro and the numbers are the same. I am a little curious what is causing the realty kit to use double the cpu power and is this a glitch that can potentially be fixed.
Posted
by Mokin.
Last updated
.