Hi,
I’m trying to project my virtual objects on a marker by using ZED 2i, and I meet some problem.
For some reasons, the unit used in my virtual models must be millimeter, which means that the size of these models in unity is 1000 times the actual size. However, as mentioned in the tutorial, the unit required for marker detection is the meter.
So,I want to know if there is a way to set the unit of the ZED marker detection to millimeter instead of meter.
Hi @JamesLee,
I’m not sure I understand, is it possible to just scale down your prefabs to 0.001?
Thanks for your reply.
I’m sorry I didn’t describe my question clearly. The unit used in my project is millimeter, and all the scripts I made are based on the millimeter unit, so it’s nearly impossible to simply scale down my prefabs to 0.001.
My goal is to change the recognition unit from meters to millimeters in the marker projection step, so that I don’t need to make extensive changes to my prefabs and scripts. In other words, when identifying the marker, change the working unit of zed or opencv to millimeters.
@JamesLee
Ok, I guess what you could do then is that when the marker is detected, change how the MarkerObject places itself in the scene.
You could add a x1000 to the position at this line.
Maybe you’d have to adjust the scale too.
Feel free to explore and adjust the other MoveToMarker
scripts in the same way.
I hope this helps.
Thank you for your reply.
I tried to modify the code and other related scripts you mentioned, but it did not achieve the desired effect.
In other words, I want to achieve the following effect: project a virtual cube with a scale of 100 in Unity onto a marker with an actual width of 0.1m, while maintaining the scale of the cube, just like the side length of the virtual cube is 0.1m.
@JamesLee
Ok, then you may need to modify the SetToMarkerSize.cs
script, I missed it when I first looked into it.
Thanks for your reply.
I modify the script you mentioned,it scales the object by changing the local scale, but this will also cause the global scale of its child objects to change, which is not the result I want. I want the global scale of my prefab to remain unchanged during the AR projection process.
Sorry, but it looks more and more like something too tricky for the plugin to handle without doing deeper modifications.
@JamesLee
Your best bet is unfortunately probably to modify the scale of your prefabs or convert your scripts from millimeter to meter.
May I ask what kind of project needed a millimeter scale rather than meters? As a general rule, I would advise always going along with meters as the main unit, as compatibility/scale issues are bound to arise.