3dsMax Exporter - Texture coordinates conversion error

I believe there is a bug when exporting from Max with KHR_texture_transform parameters in place.

I know Babylon will default to 0.5,0.5 center pivot for texture rotation, unless a glTF is using the KHR_texture_transform, in which the pivot by default is set to 0,0.

My understanding is the max exporter attempts to convert the position of the texture from 0.5,0.5 space to 0,0 and in doing so, creates new offset values to retain the original placement and orientation of the texture.

In Max I have simply rotated the texture 45° on wAngle as seen here:


When I load the model in sandbox my visual result and parameters are:


I understand the negative value on rotation is result of the coordinate system flip, but the texture is not aligned properly. What I have found, is the texture offset values are correct, but are placed in the wrong values, and requires a flip to negative on the U offset, presumably for the sake of the coordinate system change.

Fixed results here:


Thanks for listening.

:spiral_notepad: The perspective skewing of the cube is from positioning the cube conveniently next to the parameters in the UI. Otherwise, its still a perfect cube. :smiley:

Adding @Guillaume_Pelletier to have a look at this one. He is our exporters Hero :slight_smile:

Thank’s for the infos.
We already have to review the KHR_Transform, because the differents operations are not translated correctly. I will open an issue on the topic.

1 Like

Awesome! Thanks as always!

Just published a PR, please review before merge.

1 Like

Well done. Tested post-merge, and all is good!

Thanks for the quick win!