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. Dismiss Notice

Question how to get AR Camera extrinsics

Discussion in 'AR' started by chanmob, Sep 7, 2023.

  1. chanmob

    chanmob

    Joined:
    Mar 28, 2016
    Posts:
    11
    What should I do to get the extrinsics information of ar camera?
    I want to know the world matrix of the camera.
     
  2. WyattBUnity

    WyattBUnity

    Unity Technologies

    Joined:
    Mar 27, 2023
    Posts:
    31
  3. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    774
  4. chanmob

    chanmob

    Joined:
    Mar 28, 2016
    Posts:
    11
    The goal is to obtain an external parameter, which is the matrix needed to convert the camera coordinate system to world system coordinates. That means getting rotation_matrix and translation_vector.
     
  5. mekin

    mekin

    Joined:
    Mar 5, 2019
    Posts:
    11
    Sounds like you're referring to the camera's local-to-world transform? That's just
    camera.transform
    , same as any GameObject in Unity. There's nothing special about it being driven by an AR device.

    If you specifically need "the matrix needed to convert the camera coordinate system to world system coordinates", then you want the transform's localToWorldMatrix.
     
    andyb-unity likes this.