Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to cancel boundingbox #569

Open
orzabczzqq opened this issue Oct 8, 2024 · 0 comments
Open

How to cancel boundingbox #569

orzabczzqq opened this issue Oct 8, 2024 · 0 comments

Comments

@orzabczzqq
Copy link

orzabczzqq commented Oct 8, 2024

` 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant