Search Unity

Can we keep 3D objects displayed even though the target image used for tracking is out of sight?

Discussion in 'AR/VR (XR) Discussion' started by dengwentao, Sep 30, 2019.

  1. dengwentao

    dengwentao

    Joined:
    Aug 30, 2019
    Posts:
    7
    I follow this link to display a 3D model on top of a tracked image. The problem is that whenever the image is out of the AR lens I can no longer see the 3D model.
    My 3D model is for a whole room in 1:1 scale and I want to anchor it so that it matches exactly with the room. Say there's a table 10 feet away, I hope when I walk closer to that table I can see the 3D table becomes larger and larger in the AR lens. However, as I said, currently since the tracking image is no longer in the sight of the lens I cannot see any 3D object from the lens.
     
  2. riot94

    riot94

    Joined:
    Nov 5, 2018
    Posts:
    4
    I did something like that using in Unity with Google AR Core without using AR Foundation. Considering AR Foundation uses AR Core, I believe you can keep the 3D object displayed by simply un-parenting the gameobject from the image. However, I think this also results in the object not following the image anymore.

    Accuracy wise, I think it depends on the AR component's ability to determine your environment and adjust accordingly.
     
    kutlumete likes this.
  3. dengwentao

    dengwentao

    Joined:
    Aug 30, 2019
    Posts:
    7
    Thanks for your reply. Curious why so few people here. Is it possible to do something like this with the help of scripting?
    1) use the tracking image as the parent of the 3D model
    2) accurately place the 3D model with the help of tracking image
    3) un-parent the gameobject from the image
     
    zyonneo likes this.
  4. riot94

    riot94

    Joined:
    Nov 5, 2018
    Posts:
    4
    Yes that should be possible, but perhaps you've already tried that and know that now. I'm not very active on the forum either, I happened upon your question while asking my own.

    I'm not entirely certain of the steps to do 1) and 2) but 3) should just be:
    Code (CSharp):
    1. gameObject.transform.parent = null;
     
    kutlumete and zyonneo like this.