How do I center a GLB model on the Android device screen programmatically now that RenderableSource.Builder().setRecenterMode()
has been removed?
This is how I used to do it in Sceneform 1.15/1.17.1.
ModelRenderable.builder()
.setSource(
context,
RenderableSource.Builder().setSource(context, Uri.parse(uri), RenderableSource.SourceType.GLB)
.setScale(1f)
.setRecenterMode(RenderableSource.RecenterMode.CENTER)
.build()
)
.setRegistryId(uri)
.build()
.thenAccept { modelRenderable: ModelRenderable ->
Working solution adapted from SceneView: https://github.com/SceneView/sceneview-android/blob/5ede719cf10c6b72764500366802147d7323aa3f/sceneview/src/main/java/io/github/sceneview/node/ModelNode.kt#L361-L377