Closed ChrisDenham closed 9 years ago
Scaling can be really complicated. Consider this example: You are loading your model which is using millimeter as unit. Would you still like to view the model as if you were of normal height or as if you were a really tiny human?
If I interpret your pull request correctly you scale both the position and the IPD with the scale factor, i.e. you will be converted into a tiny human. Which may be correct for your application, but wrong for other users who only want to load the model as modeled in mm and then look at it as if they were of normal size.
I think that my approach would be to either scale the model with osgconv
or scale it during loading.
But your second point regarding pixelsPerDisplayPixel in viewerconfigexample.cpp is a valid bug.
The purpose of my pull request was to add some flexibility for applications that use a model space units other than metres. By default, there is no change from existing behaviour. In my application I load many models in arbitrary units, but I position them and the camera in a world space that happens to represent millimetres. So my change allows my application to pass in worldUnitsPerMetre=1000, which allows the slave camera offsets for IPD and head position to match my chosen world space units.
I see no reason to limit the choice of supported world space units to metres if my small change allows other units... which does seem to work fine for my application. It wouldn't affect anyone else unless they choose a scaling different from the default, which assume metres.
Ok, I misunderstood what you were trying to accomplish. I will merge this and add this to the two other examples as well.
Firstly, many thanks for making this open source project! Great work.
This pull request contains a small change that solves a problem that had me foxed for a while.
The problem was that when viewing my scenes with oculus, the perceived distances looked wrong and the head position tracking did not seem to be working at all. After some investigation I realized that my scenes were using millimeter world units and so was not matching up with meter units that oculus provides for head tracking position and eye separation.
So, this pull request simply allows you to pass in a scale factor (defaulting to 1.0) to allow adjustment of the slave camera offsets to match the world units of the scene.
BTW. This request also contains a correction to viewerconfigexample.cpp which passed in useTimeWarp variable as the pixelsPerDisplayPixel parameter of the OculusViewConfig constructor.
Thanks. Chris.