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

Some issue with ArSceneView

Open Razorquake opened this issue 1 year ago • 2 comments

Hello, I am new to this library and wanted to use this library in one of my projects. But the problem is, although I can show the model in 3D mode in my app using the Scene function. But in AR mode, my model is not visible. I will provide the code of the composable function that I made and the screenshot in AR mode.

@Composable
fun ARView(){
    val engine = rememberEngine()
    val modelLoader = rememberModelLoader(engine)
    val model = modelLoader.createModel("dna.glb")
    var frame by remember { mutableStateOf<Frame?>(null) }
    val childNodes = rememberNodes()
    ARScene(
        modifier = Modifier.fillMaxSize(),
        engine = engine,
        modelLoader = modelLoader,
        onSessionUpdated = { session, updatedFrame ->
            frame = updatedFrame
        },
        sessionConfiguration = {session, config ->
                               config.lightEstimationMode = Config.LightEstimationMode.DISABLED
            config.instantPlacementMode = Config.InstantPlacementMode.LOCAL_Y_UP
        },
        onGestureListener = rememberOnGestureListener(
            onSingleTapConfirmed = { motionEvent, node ->
                val hitResults = frame?.hitTest(motionEvent.x, motionEvent.y)
                val anchor = hitResults?.firstOrNull {
                    it.isValid(depthPoint = false, point = false)
                }?.createAnchorOrNull()

                if (anchor != null) {
                    val anchorNode = AnchorNode(engine = engine, anchor = anchor)
                    anchorNode.addChildNode(
                        ModelNode(modelInstance = modelLoader.createInstance(model)!!)
                    )
                    childNodes += anchorNode
                }
            }
        )
    )
}

WhatsApp Image 2024-02-08 at 18 43 15_0068c819 Note: I am using Arsceneview version 2.0.3, I have earlier used some of the older versions of the library, there my model appears in AR mode.

Razorquake avatar Feb 08 '24 13:02 Razorquake

use the "AR model view composer" sample App code . it is working correctly.

UmerHamza avatar Feb 13 '24 12:02 UmerHamza

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 14 '24 05:05 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar May 21 '24 05:05 github-actions[bot]