From 4f60137843ac7b32b489237eaf9f17ccea33e03c Mon Sep 17 00:00:00 2001 From: Nicholas Barlow Date: Thu, 9 Apr 2020 17:20:05 -0700 Subject: [PATCH] invert KHR_texture_transform vScale, due to babylon using a bottom left texture coordinate origin, and glTF expecting a top left coordinate origin (#802) --- SharedProjects/Babylon2GLTF/GLTFExporter.Texture.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SharedProjects/Babylon2GLTF/GLTFExporter.Texture.cs b/SharedProjects/Babylon2GLTF/GLTFExporter.Texture.cs index 3972517a..034d4092 100644 --- a/SharedProjects/Babylon2GLTF/GLTFExporter.Texture.cs +++ b/SharedProjects/Babylon2GLTF/GLTFExporter.Texture.cs @@ -448,9 +448,9 @@ private void AddTextureTransformExtension(ref GLTF gltf, ref GLTFTextureInfo glt KHR_texture_transform textureTransform = new KHR_texture_transform { - offset = new float[] { babylonTexture.uOffset, babylonTexture.vOffset }, + offset = new float[] { babylonTexture.uOffset, -babylonTexture.vOffset }, rotation = angle, - scale = new float[] { babylonTexture.uScale, babylonTexture.vScale }, + scale = new float[] { babylonTexture.uScale, -babylonTexture.vScale }, texCoord = babylonTexture.coordinatesIndex };