Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Solved]Create anchor in PointCloud point ARFoundation 3.0.1

Discussion in 'AR' started by jsaalva, Feb 22, 2020.

  1. jsaalva

    jsaalva

    Joined:
    Nov 19, 2019
    Posts:
    5
    Hi

    Given a selected position on the screen, i need to create an anchor at the closest possible point. My first idea was to retrieve the point cloud and for each point convert its position to screen coordinates and choose the closest one.

    In the documentation of ARPointCloud (https://docs.unity3d.com/Packages/c...UnityEngine.XR.ARFoundation.ARPointCloud.html) said:

    Positions are provided in point cloud space, that is, relative to this ARPointCloud's local position and rotation

    how can I convert the position of a point to screen space?

    I'm using ARFoundation 3.0.1 with ARCore

    Any help would be appreciated
     
  2. jsaalva

    jsaalva

    Joined:
    Nov 19, 2019
    Posts:
    5
    alternately solved
    with m_RaycastManager.Raycast (new Vector2 (x, y), hitResults, TrackableType.FeaturePoint)
     
unityunity