Fixed Float -> GLfloat conversion for current opengl library

This commit is contained in:
Matthias Schiffer 2011-01-03 15:30:03 +01:00
parent c8a67b6a5f
commit 015ebf1f57

View file

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