Corrected texture coordinates

This commit is contained in:
Matthias Schiffer 2010-04-13 21:41:15 +02:00
parent f903ac5208
commit ff46c54705

View file

@ -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)