Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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)