XbimWebUI icon indicating copy to clipboard operation
XbimWebUI copied to clipboard

Mixing wexbim-files with different model-units

Open jomijomi opened this issue 3 years ago • 2 comments

Looking through the shader code I see that you have the uMeter uniform. However, you don’t really use that in the shader. Instead, it appears that you take the model units into account when you create/update the modelview matrix. Now, if you load multiple sub-models (placed nearby each other) this obviously works well if they all have the same model-units. However, when you have two sub-models with different model-units (meters and mm, for instance, but still placed nearby each other), you then get one very big and one very small model in view (see first image). Is this behavior intentionally, i.e. you should always have same model-units on sub-models?

By taking the uMeter uniform into account in the shader it’s easy to fix this (see second image). But then the camera manipulator needs to be updated as well… (and probably other stuff as well). Any comments on this?

No_fix_in_shader

With_fix_in_shader

/Mikael

jomijomi avatar May 31 '21 22:05 jomijomi

We are still meeting also this issue. Is here something about to be done? Or is there a way to adjust units before overlaying?

tg-pool avatar Jun 17 '22 11:06 tg-pool

There are two things which can be done. You can either scale the model when creating the wexbim file, or you can make changes in the viewer to transform all the points on the fly given the scale. Both of these require some changes. I'd suggest that changing the export to wexbim would be the easier option. Your contribution to enable this functionality would be very welcome.

martin1cerny avatar Jun 20 '22 15:06 martin1cerny