From d59a03f5521460a0c0b983ecd03c7bb21b359c5a Mon Sep 17 00:00:00 2001 From: hYdos Date: Sun, 23 Feb 2020 14:39:12 +1000 Subject: [PATCH] working model loader --- .../ginger/engine/obj/OBJFileLoader.java | 8 ++++++-- .../ginger/engine/obj/OBJFileLoader.class | Bin 4990 -> 4999 bytes 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/hydos/ginger/engine/obj/OBJFileLoader.java b/src/main/java/io/github/hydos/ginger/engine/obj/OBJFileLoader.java index a78ba0f..7de67cf 100644 --- a/src/main/java/io/github/hydos/ginger/engine/obj/OBJFileLoader.java +++ b/src/main/java/io/github/hydos/ginger/engine/obj/OBJFileLoader.java @@ -83,8 +83,12 @@ public class OBJFileLoader { verticies[i++] = x; verticies[i++] = y; verticies[i++] = z; - textureCoords[j++] = vertex.getTextureIndex().x; - textureCoords[j++] = vertex.getTextureIndex().y; + + textureCoords[j * 2] = vertex.getTextureIndex().x; + textureCoords[j * 2 + 1] = 1 - vertex.getTextureIndex().y; + j++; + + } return new ModelData(verticies, textureCoords, new float[normals.sizeof()], indicesList, i); diff --git a/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class b/target/classes/io/github/hydos/ginger/engine/obj/OBJFileLoader.class index fe39e291b592988904ca8282adb69af2d37ad2ab..a69a982c96d9d678c24705e3e9d7d8100d543f59 100644 GIT binary patch delta 224 zcmeyT)~>$cv>@k926hHM1_p*@ldlLWGGWlA)c!k6|K190Nbl z@jM26hHM1_p+OldlLWGNw)bCg|ec!pbPgzK!AL7KXclk}RUE2>!jm z77j*H4pGj9|7Y%IFo@KZWYO8iaDNY*wkTWMb_SyjK$Dok=GiguPi_;^uMcA=VhCqw zV(??=VTfYj2g(;PaD(h)*v7CONP}2M8ICb9f>~P`wlFXOT{Mf~5yNAkN&F0x7@h!G zEDS;n{R~eTHZia=hyqR80c5c;Xfi}H>|}TbRBz1S&k)aW1!%G@gDXQakj2B`&S1@u PHrYa0hcRh#s<09OHZwTq