Coder Social home page Coder Social logo

Comments (7)

tdmowrer avatar tdmowrer commented on July 18, 2024 1

Support for specifying horizontal vs vertical was added in 1.0.0-preview.21.

from arfoundation-samples.

 avatar commented on July 18, 2024

Plane detection is either off or on. When on, it's both vertical and horizontal. We don't currently expose a way to only do horizontal detection. An enabled ARPlaneManager turns plane detection on. Disabling it turns it off.

from arfoundation-samples.

FoxtailGames avatar FoxtailGames commented on July 18, 2024

Just for a little help, I believe you can check via code through

plane.boundedPlane.Alignment == UnityEngine.Experimental.XR.PlaneAlignment.Horizontal

from arfoundation-samples.

ArCoreDxb avatar ArCoreDxb commented on July 18, 2024

Hi , Just a question ,

Can't we dynamically change the detection from vertical to horizontal and vice versa through code in ARFoundation ? I mean why only to be able to set in the property panel.

Plus, currently I'm building app which is doing vertical and horizontal detection , able to augment objects on detected planes BUT tracking both horizontal and vertical is causing issues , like the objects move away from their original location.

This doesn't seem to be typical normal behavior. any help??

from arfoundation-samples.

tdmowrer avatar tdmowrer commented on July 18, 2024

Can't we dynamically change the detection from vertical to horizontal and vice versa through code in ARFoundation ?

Sure. The ARPlaneManager API lets you do this.

Plus, currently I'm building app which is doing vertical and horizontal detection , able to augment objects on detected planes BUT tracking both horizontal and vertical is causing issues , like the objects move away from their original location.

I need more information to diagnose a problem like that. Please log a bug with a project that reproduces the problem.

from arfoundation-samples.

ArCoreDxb avatar ArCoreDxb commented on July 18, 2024

Can't we dynamically change the detection from vertical to horizontal and vice versa through code in ARFoundation ?

Sure. The ARPlaneManager API lets you do this.

Plus, currently I'm building app which is doing vertical and horizontal detection , able to augment objects on detected planes BUT tracking both horizontal and vertical is causing issues , like the objects move away from their original location.

I need more information to diagnose a problem like that. Please log a bug with a project that reproduces the problem.

Thanks for the reply.

Can a sample code or atleast bear minimum few code lines would really help. At the moment I'm not sure how to use this planedetection mode in my code.

Suppose I want to change it to any mode type , how will I use this property.

Really and seriously appreciate your help in this.

from arfoundation-samples.

tdmowrer avatar tdmowrer commented on July 18, 2024

Here's an example for how you might change the plane detection mode at runtime from a MonoBehaviour:

public ARPlaneManager planeManager;
void OnGUI()
{
    if (GUILayout.Button("Enable Horizontal"))
    {
        planeManager.detectionMode |= PlaneDetectionMode.Horizontal;
    }

    if (GUILayout.Button("Enable Vertical"))
    {
        planeManager.detectionMode |= PlaneDetectionMode.Vertical;
    }

    if (GUILayout.Button($"{(planeManager.enabled ? "Disable" : "Enable")} plane detection"))
    {
        // toggle plane detection
        planeManager.enabled = !planeManager.enabled;
    }
}

from arfoundation-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.