I am trying to create a realistic scene in OSG, and I have a problem with sizes.
Lets assume I will always play my little game in the same screen and therefore I know precisely the resolution and the pixel density of it.
Now, in real life, a box of 1x1x1 meters places a 10 meters from you would have an apparnet size of 10cmx10cmx10cm. I want to create the same effect.
I have a model of a box of 1x1x1 meters made on Sketchup and I place it in the scene 10 meters from the camera (I have experiemented, and I can tell OSG uses the right units). The thing is that in a window of 800x800 pixels the box is 100x100 pixels (lets say) and ina window of 80x80 pixels, the box is 10x10 pixels. What I want is the box to be 10cm always. The good thing is that I know th size,resolution and dpi of the screen I want to use for this exact project and so I can use "constants".
Still, I have no idea how to do this. My first guess would be to scale the world to match the correct size. But I am not sure what chould be the scale factor.
I haven't found any direct way to do this in OSG...
Do you have any suggestion? Thanks!