- Home /
Possibility to draw objects with real world measurements?
Hello,
I have a game to make for Windows.
This game need to have objects which have the same measures as in real world (and not depending of the screen resolution).
What I mean is if I draw an object which is one centimeter in Unity units and if I take a ruler to measure this object on the screen then I would like to measure one centimeter.
Is there any possibility to achieve this goal with unity?
Thanks in advance for any answer.
Answer by karljj1 · Feb 24, 2015 at 07:27 PM
You would need to be able to get the real world size of the screen.
This may help http://answers.unity3d.com/questions/161281/is-there-a-way-to-android-physical-screen-size.html
For example 1 cm on the x axis would be:
var pixelsInCm = Screen.width / ( Screen.dpi / 2.54f );
Thank you for your answer. It could work on most of operating systems but the problem is that on Windows Screen.dpi is always 96 (but for example on my screen my real dpi is 141: 1920x1080 15.6inches)
You want to get the real world size of a pc monitor? I'm not sure that's possible. Some monitors may have that data in the windows device but not all.