Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Detect Vertical PLane #424

Closed
SyedMoizoffical opened this issue Feb 26, 2024 · 4 comments
Closed

Detect Vertical PLane #424

SyedMoizoffical opened this issue Feb 26, 2024 · 4 comments

Comments

@SyedMoizoffical
Copy link

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
        }
    }
@UmerHamza
Copy link

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
        },

@SyedMoizoffical
Copy link
Author

Already added

@devR2id
Copy link

devR2id commented Feb 27, 2024

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.

@UmerHamza
Copy link

try this

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

@SceneView SceneView locked and limited conversation to collaborators May 27, 2024
@ThomasGorisse ThomasGorisse converted this issue into discussion #512 May 27, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants