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

Detect Vertical PLane

Open SyedMoizoffical opened this issue 1 year ago • 4 comments

place object on vertical surface  ,Issue is that in not detect vertical surface ,Horizontally work fine ,

   sceneView = findViewById<ARSceneView?>(R.id.sceneView).apply {
        planeRenderer.isEnabled = true
        configureSession { session, config ->
            config.depthMode = when (session.isDepthModeSupported(Config.DepthMode.AUTOMATIC)) {
                true -> Config.DepthMode.AUTOMATIC
                else -> Config.DepthMode.DISABLED
            }
            config.planeFindingMode=Config.PlaneFindingMode.VERTICAL
            config.instantPlacementMode = Config.InstantPlacementMode.DISABLED
            config.lightEstimationMode = Config.LightEstimationMode.ENVIRONMENTAL_HDR
        }
        onSessionUpdated = { _, frame ->
            if (anchorNode == null) {
                frame.getUpdatedPlanes()
                    .firstOrNull { it.type == Plane.Type.VERTICAL }
                    ?.let { plane ->
                       addAnchorNode(plane.createAnchor(plane.centerPose))
                    }
            }
        }
        onTrackingFailureChanged = { reason ->
            [email protected] = reason
        }
    }

SyedMoizoffical avatar Feb 26 '24 11:02 SyedMoizoffical

sessionConfiguration = { session, config -> config.depthMode = when (session.isDepthModeSupported(Config.DepthMode.AUTOMATIC)) { true -> Config.DepthMode.AUTOMATIC else -> Config.DepthMode.DISABLED } config.lightEstimationMode = Config.LightEstimationMode.ENVIRONMENTAL_HDR

            config.planeFindingMode = Config.PlaneFindingMode.VERTICAL.    // add this for vertical surface
        },

UmerHamza avatar Feb 27 '24 14:02 UmerHamza

Already added

SyedMoizoffical avatar Feb 27 '24 15:02 SyedMoizoffical

Have you tried Config.PlaneFindingMode.HORIZONTAL_AND_VERTICAL?

In the little time I've been developing with this library, I don't notice that the VERTICAL configuration was available.

devR2id avatar Feb 27 '24 22:02 devR2id

try this

frame.getUpdatedPlanes() .firstOrNull() ?.let { plane -> addAnchorNode(plane.createAnchor(plane.centerPose)) }

UmerHamza avatar Feb 28 '24 06:02 UmerHamza