SceneView / sceneview-android

SceneView is a 3D and AR Android Composable and View with Google Filament and ARCore. This is a Sceneform replacement in Kotlin
Apache License 2.0
850 stars 161 forks source link

How to cancel boundingbox #569

Open orzabczzqq opened 1 month ago

orzabczzqq commented 1 month ago

` private fun loadModel() { viewLifecycleOwner.lifecycleScope.launch {

        val modelFile = "test/test2.glb"
        val modelInstance = binding.sceneView.modelLoader.createModelInstance(modelFile)

        val modelNode = ModelNode(
            modelInstance = modelInstance,
        )

        binding.sceneView.addChildNode(modelNode)

        touchEvent()
    }
}
private fun handleTouch(motionEvent: MotionEvent, hitResult: HitResult?) {
    when (motionEvent.action) {
        MotionEvent.ACTION_DOWN -> {
            hitResult?.let { hit ->
                val hitPosition = Position(hit.point.x, hit.point.y, hit.point.z)
                addSphere(roundedPosition)
            }
        }
    }
}

`

I try to create a circle shape at the coordinates obtained by HitResult, but the coordinates are the boundingbox and not the model itself.