Open orzabczzqq opened 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.
` private fun loadModel() { viewLifecycleOwner.lifecycleScope.launch {
`