augmented-reality

How to detect penetration without physical interaction in ARKit?

不想你离开。 提交于 2021-02-20 00:59:06
问题 I have a fixed laser beam SCNNode and a detecting sphere SCNNode attached in front of a camera. How to detect penetration without physical interaction? I have not found any clue.. EDIT: - as suggested below by maxxFrazer I implemented physical interaction and I'm able to register collision IF my laser beam is .static and detector moved by camera set .kinematic. 回答1: If you need to detect a penetration without physical interaction use trackedRaycast instance method working in iOS 13+: func

How to draw line node keep same size in camera as Measure App in iPhone?

隐身守侯 提交于 2021-02-19 09:00:23
问题 I try make an AR app as a Measure default app in iPhone. ( I base on project TBXark/Ruler on github) I draw startNode, endNode, cylinder line, and SCNText. But I can't manage the scale of size, it only readable in near, and so small when measure far plane detect. I have 2 question: How to keep size node, cylinder and text same when draw near or far as Measure App How to draw scntext with background and align the same direction cylinder line as Measure App. Here is my Line Node class: class

How do I save and load ARWorldMap in SwiftUI app?

岁酱吖の 提交于 2021-02-19 05:38:26
问题 I followed a YouTube tutorial on how to place virtual Models in SwiftUI. Now that I can place my Models, I would like to save and load the models position. I have already made 2 Buttons for save and load, but I don't know the correct code to save and load the Entities and Anchors. The following code is inside my updateUIView function: func updateUIView(_ uiView: ARView, context: Context) { if let name = self.modelName { print("Modell mit dem Namen \(name) wurde zum plaziert") let filename =

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:

ARKit – Spatial Audio barely changes the volume over distance

大城市里の小女人 提交于 2021-02-08 07:17:38
问题 I created a SCNNode and added an Audio to it. It is a Mono audio. Everything is set up correctly. It is working as Spatial Audio, that's not the problem. The problem is that as i get closer or far away it barely changes the volume. I know it changes if i get very very far away, but it's nothing like Apple demonstrated here: https://youtu.be/d9kb1LfNNU4?t=23 Some other games i see the audio volume really changing from one step distance. With mine, with one step you can't even tell the volume

ARKit : Make virtual 3D objects to point towards camera

懵懂的女人 提交于 2021-02-08 03:46:48
问题 I am trying to build an app based on ARKit to place 3D virtual objects on to the plane that is detected. I found a useful project on GitHub Placing Virtual Objects This does the job exactly what I am looking for. However, when any virtual object is placed in front of the camera, it may or may not face the camera. Sometimes 3D objects look in the opposite direction of camera I have tried to add SCNconstraints to virtual object node and tweak the rotation and orientation of 3D Models to look at

ARKit : Make virtual 3D objects to point towards camera

微笑、不失礼 提交于 2021-02-08 03:46:28
问题 I am trying to build an app based on ARKit to place 3D virtual objects on to the plane that is detected. I found a useful project on GitHub Placing Virtual Objects This does the job exactly what I am looking for. However, when any virtual object is placed in front of the camera, it may or may not face the camera. Sometimes 3D objects look in the opposite direction of camera I have tried to add SCNconstraints to virtual object node and tweak the rotation and orientation of 3D Models to look at

Occlusion Material or Hold-Out Shader in ARKit and SceneKit

拜拜、爱过 提交于 2021-02-06 12:30:41
问题 I have seen some examples demo of ARKit where material A is blocking material B, kind of creating occlusion effect, or black hole, or masking. But all of them seems to be using Unity engine (I might be wrong). I wanted to do this using what Apple provide already. Or maybe using Metal Shader. Wondering if anyone knows a trick that allows this for ARKit or even in SceneKit term, when 2 objects are overlapping, but wanting one object to occlude the other object, leaving the other object empty.

Occlusion Material or Hold-Out Shader in ARKit and SceneKit

断了今生、忘了曾经 提交于 2021-02-06 12:29:51
问题 I have seen some examples demo of ARKit where material A is blocking material B, kind of creating occlusion effect, or black hole, or masking. But all of them seems to be using Unity engine (I might be wrong). I wanted to do this using what Apple provide already. Or maybe using Metal Shader. Wondering if anyone knows a trick that allows this for ARKit or even in SceneKit term, when 2 objects are overlapping, but wanting one object to occlude the other object, leaving the other object empty.

opening camera in Expo

故事扮演 提交于 2021-01-29 06:37:27
问题 I am trying to run this code (https://snack.expo.io/Hk1C_YqjW) on my android device using Expo XDE , but when it comes to this line: const arSession = await this._glView.startARSessionAsync(); shows this error and stops: [Unhandled Promise rejection: TypeError: undefined is not an object (evaluating '_reactNative.NativeModules.ExponentGLViewManager.startARSessionAsync')] What is the problem? 回答1: Expo doesn't support ARCore on Android yet, only ARKit on iOS. See more information at https:/