NiUVController doesn't calculate the UV offset properly
Found by Kurp. Problem 10 in #5988.
NiUVController is a controller that animates UV transformations. It can change the texture's offset and scale and is commonly used in Morrowind to simulate liquid movement (moving water, lava and lava crust).
The movement is currently implemented through a texture transformation matrix. Originally after the OSG port it scaled the texture relative to its origin (lower left corner in OpenGL) and then added the UV offsets to the texture coordinates. All of these operations are wrong, as NiUVController
a) is supposed to scale the texture relative to its center;
b) uses a coordinate system where the X axis is directed west and Y axis is directed south. while OpenGL uses a coordinate system where the Y axis is directed north.
The last mentioned issue was later attempted to be corrected by scrawl, but he used a flip matrix that still only makes sense if you flip the texture relative to a corner origin and not the center, so while it fixed Vivec waterfalls:
it only made the other offset issues worse, as Kurp found out (see the relevant model and report in #5988).
And this model demonstrates the flipped horizontal offset issue: testxoffset.nif
In both Morrowind and NifSkope the picture is moving to the lower left corner while in the current OpenMW it is moving to the lower right corner.
So the calculated UV offset needs to be adjusted to make the scaling relative to the origin while both the horizontal and the vertical offset need to be subtracted from the texture coordinates. The resulting transformation should roughly be the same as in NifSkope and Greatness7's Blender NIF plugin (which in their turn act the same as SceneImmerse, which in its turn should be identical to Morrowind) except NifSkope doesn't flip the vertical offset as it doesn't need to.