I am trying to play with Augmented Reality using Reality Kit.
I want to have my program do one of the following things, selectable by the user:
- Detect horizontal surfaces only.
- Detect vertical surfaces only.
- Detect both, horizontal and vertical surfaces.
- Detect images, like I print a target, attach to an object on the real world and the app detects it.
In order to do that I have, as far as I understand, to adjust 3 things:
ARWorldTrackingConfiguration
doing something like
func initSession() {
let config = ARWorldTrackingConfiguration()
config.planeDetection = .vertical
arView.session.delegate = self
arView.session.run(config)
}
Create scenes inside Experience.rcproject
One for the type of anchoring I need. I have created three "scenes" with the following anchor types: horizontal, vertical and image.
Create an ARCoachingOverlayView
To instruct the user to make the detection work properly.
These are the problems:
ARWorldTrackingConfigurationhas only two options forplaneDetection:horizontalorvertical.The scenes inside
Experience.rcproject, can only be of 3 kinds:horizontal,verticalorimage.The options for
ARCoachingOverlayView.goalare:tracking(that is difficult to figure out without proper documentation),horizontalPlane,verticalPlaneandanyPlane.
Questions:
How do I configure
ARWorldTrackingConfigurationandARCoachingOverlayView.goalto make the app detecthorizontalonly,verticalonly,horizontal and verticalandimagesif they don't have all these four options?I have 3 scenes inside
Experience.rcprojectone forhorizontal, one forverticaland one forimagedetection. Is that how to do it?