From ff46c547057922190d79f4c1d62d5a95a02f5899 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 13 Apr 2010 21:41:15 +0200 Subject: Corrected texture coordinates --- src/Data/Obj3D/GL.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Data') diff --git a/src/Data/Obj3D/GL.hs b/src/Data/Obj3D/GL.hs index 1cfa5c6..30169b4 100644 --- a/src/Data/Obj3D/GL.hs +++ b/src/Data/Obj3D/GL.hs @@ -66,10 +66,10 @@ getIndex v = do return i makeVertexData :: ObjModel -> FaceVertex -> Interleaved -makeVertexData model (v, t, n) = Interleaved ts tt nx ny nz vx vy vz +makeVertexData model (v, t, n) = Interleaved tu (-tv) nx ny nz vx vy vz where (vx, vy, vz) = genericIndex (objVertices model) v - (ts, tt) = if isJust t then genericIndex (objTexCoords model) $ fromJust t else (0, 0) + (tu, tv) = if isJust t then genericIndex (objTexCoords model) $ fromJust t else (0, 0) (nx, ny, nz) = if isJust n then genericIndex (objNormals model) $ fromJust n else (0, 0, 0) -- cgit v1.2.3