Search Unity

Resolved Using .ARObject

Discussion in 'AR' started by RaviNSwami, Jun 8, 2022.

  1. RaviNSwami

    RaviNSwami

    Joined:
    May 27, 2022
    Posts:
    7
    Hi,

    I have saved an ".ARobject" point data file from a scan of a real-world object using my iPhone and would like some pointers on how to use this within Unity.

    I have imported a script: "GenerateObjectAnchor.cs" from a demo scene, however this produces errors.

    I have both AR Foundation and ARKit installed.

    The aim is to be able to attach an object or plane to a real world 3D object rather than to a 2D target image, when viewed with the device camera.

    Ravi
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  3. RaviNSwami

    RaviNSwami

    Joined:
    May 27, 2022
    Posts:
    7
    Thank you - additionally, unless I'm missing something, it would be handy to have a visual representation of the scan point cloud in the viewport, in order to make object placement more accurate.

    So far it seems to be a matter of trial and error to get objects / planes to line up.

    R
     
  4. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    If you mean the point cloud of points detected by the AR Camera at runtime then you just need to use the AR Point Cloud Manager component.
     
  5. RaviNSwami

    RaviNSwami

    Joined:
    May 27, 2022
    Posts:
    7
    Hi,

    Thank you - firstly, I have managed to locate an Object Tracking demo scene file from ARFoundation that allows me to achieve the intended gaol of having an AR object track to a scanned real world 3D object.

    However, is it possible to display the ".arobject" in the Unity Scene Editor, since currently it only exists as an asset within an "ARTracked Object Manager"?.

    Being able to actually see the scanned object within the scene editor would make alignment of virtual elements more accurate, whereas at the moment it is very much a case of hit and miss.

    Ravi
     
  6. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
  7. RaviNSwami

    RaviNSwami

    Joined:
    May 27, 2022
    Posts:
    7
    Oh OK - I missed that :)

    I'm trying a workaround featuring a bounding box with the same dimensions as the scanned object to help with alignment of AR elements.

    Obviously this would be removed before building the app.

    R