reality-composer

Implement a crosshair kind behaviour in RealityKit

我们两清 提交于 2021-02-10 17:45:50
问题 What I want to achieve: Attach a sphere to the camera position (so that it always stay at the center of the screen as the device move) and detect when it is on top of other AR objects - to trigger other actions/behaviour on the AR objects. Approach: I have created the sphere and attached to the center of the screen as shown below @IBOutlet var arView: ARView! override func viewDidLoad() { super.viewDidLoad() let mesh = MeshResource.generateSphere(radius: 0.1) let sphere = ModelEntity(mesh:

RealityKit – Load another Scene from the same Reality Composer project

眉间皱痕 提交于 2020-08-03 08:14:26
问题 I create an Augmented Reality Project using Xcode's template. Xcode creates a file called Experience.rcproject . This project contains a scene called Box and a cube called Steel Cube . I add 3 more scenes to Experience.rcproject , called alpha , bravo and delta . I run the project. Xcode runs these two lines // Load the "Box" scene from the "Experience" Reality File let boxAnchor = try! Experience.loadBoxX(namedFile: "Ground") // Add the box anchor to the scene arView.scene.anchors.append

How do I access the model component of Reality Composer in RealityKit?

孤人 提交于 2020-07-09 07:58:08
问题 I'm trying to change the model component of a text entity created in Reality Composer in my code, but this as! casting the gui-created entity to a reference to an entity with a model component failed. self.entityReference = scene.realityComposerEntity as! HasModel textEntity.model!.mesh = MeshResource.generateText("New Text") The text entity in RealityKit should have a model property as it has a visual appearance in the ARView, but I don't know how to access it. Does anyone have any idea how?

Extract Reality Composer scene for ARQuickLook

↘锁芯ラ 提交于 2020-07-08 20:43:26
问题 I have a Reality Composer scene and I want to extract it as usdz file or any files that can be used in ARQuickLook ? is it possible? 回答1: From Apple's Creating 3D Content with Reality Composer document: You can also save your composition to a .reality file for use as a lightweight AR Quick Look experience in your app or on the web. This allows users to place and preview content in the real world to get a quick sense of what it’s like. To create a Reality file, choose File > Export > Export

Dynamically change text of RealityKit entity

时间秒杀一切 提交于 2020-06-25 06:45:33
问题 I have created a very simple scene ("SpeechScene") using Reality Composer, with a single speech callout object ("Speech Bubble") anchored to a Face anchor. I have loaded this scene into code via the following: let speechAnchor = try! Experience.loadSpeechScene() arView.scene.anchors.append(speechAnchor) let bubble = (arView.scene as? Experience.SpeechScene)?.speechBubble It renders as expected. However, I would like to dynamically change the text of this existing entity. I found a similar

Multi-face detection in RealityKit

允我心安 提交于 2020-06-25 05:44:28
问题 I have added content to the face anchor in Reality Composer, later on, after loading the Experience that i created on Reality Composer, i create a face tracking session like this: guard ARFaceTrackingConfiguration.isSupported else { return } let configuration = ARFaceTrackingConfiguration() configuration.maximumNumberOfTrackedFaces = ARFaceTrackingConfiguration.supportedNumberOfTrackedFaces configuration.isLightEstimationEnabled = true arView.session.delegate = self arView.session.run