Instant anchoring with multiple independent models #104
-
Hi! What would be the best way to have several models instantly anchor around a common point without overlapping (i.e. arranged in a line or a circle or whatever), but still be able to be independently moved around and rotated? I've tried several things with centerOrigin and onAnchorChanged, but all my models either bunch up in the center, or behave strangely when moved. Thanks in advance! edit: I seem to be making some progress with the CursorNode and messing with the worldPosition of the newly-loaded models, but if I spawn them in on the first time the cursor's onPoseChanged fires, the models appear in the distance. Is there something like a confidence rating for the cursor's position that I can use, or do I just add a timeout and hope for the best? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi! |
Beta Was this translation helpful? Give feedback.
-
By default the And as mentioned here the ArNode will be first placed using instant placement which is not meant to be used for accuracy.You can disable the instant placement fallback: arNode.placementMode.instantPlacementFallback = false or listen for cursorNode.onHitResult = { _, hitResult ->
val isAccurate = hitResult?.isTracking == true &&
hitResult.trackable !is InstantPlacementPoint
// Set the CursorNode color to red if not accurate
cursorNode.isTracking = isAccurate
// Hide or show the model
modelNode.isVisible = isAccurate
} Have a look at this part: |
Beta Was this translation helpful? Give feedback.
By default the
ArModelNode
(so theCursorNode
) is using thePlacementMode.BEST_AVAILABLE
defined withinstantPlacementFallback = true
sceneview-android/arsceneview/src/main/java/io/github/sceneview/ar/node/ArNode.kt
Lines 503 to 509 in 6260bf7