Skip to content

Detect Vertical PLane #424

@SyedMoizoffical

Description

@SyedMoizoffical
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 ->
            this@MainActivity.trackingFailureReason = reason
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions