Closed syedali1621 closed 3 years ago
Hello. I didn't get your question.
If you want to convert a 2d position on the screen to a 3d position in AR scene, you can call this method: https://github.com/derenlei/Unity_Detection2AR/blob/main/Assets/Scripts/AnchorCreator.cs#L36-L70.
It performs raycast based on given (x,y) and uses the closest hit as the AR scene position. Then pair the hit position with the given bounding box. I assume you want to use the hit position to create a 3d model anchor.
The default 2d position of bounding box is the center of it, as raycast has a higher chance to actually hit the object. You could try something else.
I am using yolov2tiny and showing 3d model at center of camera but when i start the app from left or right position and detect object then it show the 3d model on left or right position but i want to change the 3d model position to show on the same place where bounding box is visible. How can i get bounding box position ? I can change it using transform.position but i want to know how to get bounding box position?
Thank you