WIP, does not compile.
This commit is contained in:
parent
87946cb501
commit
a3f0043591
@ -216,7 +216,7 @@ parseIQM a =
|
|||||||
vbo <- sequence $ map toVBOfromVAO va
|
vbo <- sequence $ map toVBOfromVAO va
|
||||||
return $ raw
|
return $ raw
|
||||||
{ vertexArrays = va'
|
{ vertexArrays = va'
|
||||||
, vertexArrayObjects = vbo
|
, vertexBufferObjects = vbo
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Creates a BufferObject on the Graphicscard for each BufferObject
|
-- | Creates a BufferObject on the Graphicscard for each BufferObject
|
||||||
|
@ -109,7 +109,8 @@ data IQM = IQM
|
|||||||
, texts :: [ByteString]
|
, texts :: [ByteString]
|
||||||
, meshes :: [IQMMesh]
|
, meshes :: [IQMMesh]
|
||||||
, vertexArrays :: [IQMVertexArray]
|
, vertexArrays :: [IQMVertexArray]
|
||||||
, vertexArrayObjects :: [BufferObject]
|
, vertexBufferObjects :: [BufferObject]
|
||||||
|
, vertexArrayObject :: VertexArrayObject
|
||||||
} deriving (Show, Eq)
|
} deriving (Show, Eq)
|
||||||
|
|
||||||
-- | Different Vertex-Array-Types in IQM
|
-- | Different Vertex-Array-Types in IQM
|
||||||
|
@ -34,7 +34,7 @@ instance GLCamera Camera where
|
|||||||
getCam (Flat (x',z')) dist' xa' ya' =
|
getCam (Flat (x',z')) dist' xa' ya' =
|
||||||
lookAt (cpos ^+^ at') at' up
|
lookAt (cpos ^+^ at') at' up
|
||||||
where
|
where
|
||||||
at' = V3 x 0 z
|
at' = V3 x (y+1) z
|
||||||
cpos = crot !* (V3 0 0 (-dist))
|
cpos = crot !* (V3 0 0 (-dist))
|
||||||
crot = (
|
crot = (
|
||||||
(fromQuaternion $ axisAngle upmap (xa::CFloat))
|
(fromQuaternion $ axisAngle upmap (xa::CFloat))
|
||||||
@ -52,7 +52,7 @@ instance GLCamera Camera where
|
|||||||
getCam (Sphere (inc',az') r') dist' xa' ya' = --inclination (pitch), azimuth (yaw)
|
getCam (Sphere (inc',az') r') dist' xa' ya' = --inclination (pitch), azimuth (yaw)
|
||||||
lookAt (cpos ^+^ at') at' up
|
lookAt (cpos ^+^ at') at' up
|
||||||
where
|
where
|
||||||
at' = sphereToCart r inc az
|
at' = sphereToCart (r+1) inc az
|
||||||
cpos = crot !* (V3 0 0 (-dist))
|
cpos = crot !* (V3 0 0 (-dist))
|
||||||
crot = (
|
crot = (
|
||||||
(fromQuaternion $ axisAngle upmap (xa::CFloat))
|
(fromQuaternion $ axisAngle upmap (xa::CFloat))
|
||||||
@ -76,4 +76,4 @@ sphereToCart :: (Floating a) => a -> a -> a -> V3 a
|
|||||||
sphereToCart r inc az = V3
|
sphereToCart r inc az = V3
|
||||||
(r * (sin inc) * (cos az))
|
(r * (sin inc) * (cos az))
|
||||||
(r * (sin inc) * (sin az))
|
(r * (sin inc) * (sin az))
|
||||||
(r * (cos inc))
|
(r * (cos inc))
|
||||||
|
Loading…
Reference in New Issue
Block a user