sceneview-android icon indicating copy to clipboard operation
sceneview-android copied to clipboard

How to cancel boundingbox

Open orzabczzqq opened this issue 1 year ago • 0 comments

` 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.

orzabczzqq avatar Oct 08 '24 09:10 orzabczzqq