Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to use ARTrackedImage?

Discussion in 'AR' started by 2rusbekov, Jun 23, 2019.

  1. 2rusbekov

    2rusbekov

    Joined:
    Jul 12, 2013
    Posts:
    43
    Hi! I got lists with ARTrackedImages from ARTrackedImageManager.trackedImagesChanged event and I want to place custom object on that image "plane". I tried to use position, rotation, localScale, size, extents of this objects, but really changes only position. I noticed that ARTrackable has sessionRelativeData field with type of
    XRTrackedImage that has Pose object, but sessionRelativeData is proteceted. What should I use to get tracked images rotation and size relative to ar camera?
     
  2. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    605
    That is the correct thing to do, and it's what we use in the sample script. You're saying this does not work for you?

    Edit: Fixed link to sample code.
     
    Last edited: Jul 11, 2019
  3. 2rusbekov

    2rusbekov

    Joined:
    Jul 12, 2013
    Posts:
    43
    Oh, I found out the problem. I prepared my objects as 2d in XY dimensions, example uses XZ. Thank for help.
     
  4. kr_vs

    kr_vs

    Joined:
    Mar 14, 2015
    Posts:
    6
    How to get access to okta?
     
  5. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    Sorry, that link was incorrect. The sample script discussed is here.
     
  6. kr_vs

    kr_vs

    Joined:
    Mar 14, 2015
    Posts:
    6
    Hey, how can i track 2 or 3 objects? I assume that i have reset AR Session and add another image library and tracked object, but it doesnt work for me. Pls help!