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:
ARWorldTrackingConfiguration
has only two options forplaneDetection
:horizontal
orvertical
.The scenes inside
Experience.rcproject
, can only be of 3 kinds:horizontal
,vertical
orimage
.The options for
ARCoachingOverlayView.goal
are:tracking
(that is difficult to figure out without proper documentation),horizontalPlane
,verticalPlane
andanyPlane
.
Questions:
How do I configure
ARWorldTrackingConfiguration
andARCoachingOverlayView.goal
to make the app detecthorizontal
only,vertical
only,horizontal and vertical
andimages
if they don't have all these four options?I have 3 scenes inside
Experience.rcproject
one forhorizontal
, one forvertical
and one forimage
detection. Is that how to do it?