Search Unity

Placing a virtual object according to calculated marker position and orientation

Discussion in 'Scripting' started by Elisabeth123, Jun 12, 2019.

  1. Elisabeth123

    Elisabeth123

    Joined:
    Feb 17, 2016
    Posts:
    13
    Hi,
    I have the following problem:
    I am writing an AR application where I would like to place a virtual object where the accordant marker is detected. For the marker detection I am using a C++ framework which gives me back a matrix that holds the rotation and translation information. Now I would like to place my virtual object accordant to that marker which should have the same size. My problem now is: how can I find out the FOV of the webcam I am using? I had a look in the specs but when I use the same FOV the size of the object is not right. Should I use physical camera? If so how can I get the sensor size. In the specs there is only the focal length but nothing about the sensor size. The virtual object has the right size in Unity when I am assuming that units in Unity are meters.

    Thanks a lot in advance!