diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-04-13 21:41:15 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-04-13 21:41:15 +0200 |
commit | ff46c547057922190d79f4c1d62d5a95a02f5899 (patch) | |
tree | 44510c4d9de279b26272024de977d0e49fe968c2 /src/Data/Obj3D | |
parent | f903ac52089d2cd0eb087401120fde7b34202c4d (diff) | |
download | obj-model-opengl-ff46c547057922190d79f4c1d62d5a95a02f5899.tar obj-model-opengl-ff46c547057922190d79f4c1d62d5a95a02f5899.zip |
Corrected texture coordinates
Diffstat (limited to 'src/Data/Obj3D')
-rw-r--r-- | src/Data/Obj3D/GL.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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) |