I'm a bit confused because UVs are generally a relative spatial coordinate system. "Relative" is the key word as they do not correspond to measurable distances. So I don't understand why there would be a need to convert TextureRealWorldScaleX/Y to another unit if normalization is ultimately x/y or y/x.
Of course I'm pretty sure I don't understand how Revit is calculating it's UVs. It seems crazy that when we ask for UVs it gives us UVs that are not usable UVs (unless the texture dimensions are 1:1) - the whole purpose of UVs is to allow us to ignore texture dimensions. But I understand it may make the Revit developers lives easier as it allows for interesting tiling dynamics when interchanging textures.
In any case, I attempted what I thought was a way to normalize given texture dimensions:
normailze_multiplier = scaleX / (scaleY + ((scaleX - scaleY) / 2))
If scaleX was 14 and scaleY was 10 (inch, cm, it shouldn't really matter), then I see UVs that go from (0, 0) to (1.167, 0.833). normalize_multiplier then comes out to be 1.167. So (/, *) results in (1, 1).
But, unfortunately, that doesn't always work and I see erroneous UVs elsewhere. So I need more information:
- What are the UVs we are getting from Revit - they are not classic UVs so what do they really represent?
- What is the appropriate algorithm to convert or normalize the UVs based on texture dimensions?
- Is there a function that already does this conversion?
- How does TextureRealWorldOffsetX/Y affect the UVs?
- How does TextureWAngle affect the UVs?
Thanks,
Jason