From 015ebf1f5784c781b175ee0c338f95a3c7d3fe21 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 3 Jan 2011 15:30:03 +0100 Subject: Fixed Float -> GLfloat conversion for current opengl library --- src/Data/Obj3D/OpenGL.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Data/Obj3D/OpenGL.hs b/src/Data/Obj3D/OpenGL.hs index 0e9b5c5..b126310 100644 --- a/src/Data/Obj3D/OpenGL.hs +++ b/src/Data/Obj3D/OpenGL.hs @@ -68,9 +68,11 @@ getIndex v = do makeVertexData :: ObjModel -> FaceVertex -> Interleaved makeVertexData model (v, t, n) = Interleaved tu (-tv) nx ny nz vx vy vz where - (vx, vy, vz) = genericIndex (objVertices model) v - (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) + (vx, vy, vz) = rtf3 $ genericIndex (objVertices model) v + (tu, tv) = rtf2 $ if isJust t then genericIndex (objTexCoords model) $ fromJust t else (0, 0) + (nx, ny, nz) = rtf3 $ if isJust n then genericIndex (objNormals model) $ fromJust n else (0, 0, 0) + rtf2 (x, y) = (realToFrac x, realToFrac y) + rtf3 (x, y, z) = (realToFrac x, realToFrac y, realToFrac z) interleaveObj :: ObjModel -> ([Interleaved], [[Integer]]) -- cgit v1.2.3