Search Unity

Question Rotating AR spawned object with real world

Discussion in 'AR' started by ibrahim_unity247, Jun 17, 2022.

  1. ibrahim_unity247

    ibrahim_unity247

    Joined:
    Apr 1, 2022
    Posts:
    1
    Hi all,

    Hope you are all in good health.

    So I have an issue in AR. My task is to rotate my AR spawned object with a real world object. For example I have a box in real world and according to my AR camera I spawn an AR object and make it fit perfectly on that box. Now the real world object is rotating on Y-axis randomly and I want to rotate my AR object with it so that the AR object stays on the real world object. I have tried Cylindrical tracking of vuforia but my model is alot complex and I cannot afford Vuforia's Model Tracking. So right now I have an ARDUINO sensor attached with my real object that gives me rotation of the real world object on y axis. Now my camera is not at the same rotation and angle with the real world object so the object that I spawn I have to rotate and reposition it to fit on the target. But that actually effects the rotations as well when the target rotates I rotate AR object on same axis and it works fine but as the real world object and AR object dont have the same rotation, on rotating at Y-axis my AR object starts to tilt from the real world object. Is there a solution to fix this?

    I will be really thankful for this help.

    It rotates fine on Y axis but due to AR camera orientation the AR object when rotated dont stay on the target
    Screenshot 2022-06-17 180819.png Screenshot 2022-06-17 180447.png
    Screenshot 2022-06-17 180819.png