Safe Haskell | None |
---|---|
Language | Haskell2010 |
Simplified 3D graphics system.
- type Object3D = Object Uniforms3D Geometry3D
- type IsObject3D gs is = (Subset Geometry3D is, Subset (View3 ': Uniforms3D) gs, ShaderVars is, ShaderVars gs)
- cube :: GLES => Texture -> Object3D
- mesh :: GLES => Texture -> Geometry is -> Object Uniforms3D is
- trans :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is
- rotX :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is
- rotY :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is
- rotZ :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is
- rot :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Float -> Object gs is -> Object gs is
- scale :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is
- scaleV :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is
- transform :: (MemberGlobal Transform3 gs, GLES) => Mat4 -> Object gs is -> Object gs is
- view :: (GLES, ShaderVars gs, ShaderVars is) => Mat4 -> [Object gs is] -> Object (View3 ': gs) is
- viewPersp :: (GLES, ShaderVars gs, ShaderVars is) => Float -> Float -> Float -> Mat4 -> [Object gs is] -> Object (View3 ': gs) is
- viewOrtho :: (GLES, ShaderVars gs, ShaderVars is) => Float -> Float -> Float -> Float -> Float -> Float -> Mat4 -> [Object gs is] -> Object (View3 ': gs) is
- viewVP :: (GLES, ShaderVars gs, ShaderVars is) => (Vec2 -> Mat4) -> [Object gs is] -> Object (View3 ': gs) is
- layerS :: IsObject3D gs is => Object gs is -> Layer' s t ()
- perspectiveMat4 :: Float -> Float -> Float -> Float -> Mat4
- perspectiveMat4Size :: Float -> Float -> Float -> Vec2 -> Mat4
- orthoMat4 :: Float -> Float -> Float -> Float -> Float -> Float -> Mat4
- cameraMat4 :: Vec3 -> Float -> Float -> Mat4
- lookAtMat4 :: Vec3 -> Vec3 -> Vec3 -> Mat4
- transMat4 :: Vec3 -> Mat4
- rotXMat4 :: Float -> Mat4
- rotYMat4 :: Float -> Mat4
- rotZMat4 :: Float -> Mat4
- rotMat4 :: Vec3 -> Float -> Mat4
- scaleMat4 :: Vec3 -> Mat4
- type Uniforms3D = '[Transform3, Texture2]
- data Texture2 = Texture2 GSampler2D
- data Transform3 = Transform3 GMat4
- data View3 = View3 GMat4
3D Objects
type Object3D = Object Uniforms3D Geometry3D Source #
A standard 3D object, without the View3
matrix.
type IsObject3D gs is = (Subset Geometry3D is, Subset (View3 ': Uniforms3D) gs, ShaderVars is, ShaderVars gs) Source #
3D objects compatible with the standard 3D shader program.
mesh :: GLES => Texture -> Geometry is -> Object Uniforms3D is Source #
A 3D object with a specified Geometry
.
Transformations
trans :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is Source #
Translate a 3D Object.
rotX :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Rotate a 3D Object
around the X axis.
rotY :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Rotate a 3D Object
around the Y axis.
rotZ :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Rotate a 3D Object
around the Z axis.
rot :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Float -> Object gs is -> Object gs is Source #
Rotate a 3D Object
around a vector.
scale :: (MemberGlobal Transform3 gs, GLES) => Float -> Object gs is -> Object gs is Source #
Scale a 3D Object
.
scaleV :: (MemberGlobal Transform3 gs, GLES) => Vec3 -> Object gs is -> Object gs is Source #
Scale a 3D Object
in three dimensions.
transform :: (MemberGlobal Transform3 gs, GLES) => Mat4 -> Object gs is -> Object gs is Source #
Transform a 3D Object
.
Layers
view :: (GLES, ShaderVars gs, ShaderVars is) => Mat4 -> [Object gs is] -> Object (View3 ': gs) is Source #
Create a group of objects with a view matrix.
:: (GLES, ShaderVars gs, ShaderVars is) | |
=> Float | Near |
-> Float | Far |
-> Float | FOV |
-> Mat4 | View matrix |
-> [Object gs is] | |
-> Object (View3 ': gs) is |
Create a group of objects with a view matrix and perspective projection.
:: (GLES, ShaderVars gs, ShaderVars is) | |
=> Float | Near |
-> Float | Far |
-> Float | Left |
-> Float | Right |
-> Float | Bottom |
-> Float | Top |
-> Mat4 | View matrix |
-> [Object gs is] | |
-> Object (View3 ': gs) is |
Create a group of objects with a view matrix and orthographic projection.
viewVP :: (GLES, ShaderVars gs, ShaderVars is) => (Vec2 -> Mat4) -> [Object gs is] -> Object (View3 ': gs) is Source #
Create a group of objects with a view matrix, depending on the size of the framebuffer.
layerS :: IsObject3D gs is => Object gs is -> Layer' s t () Source #
A Layer
with the standard 3D program.
Matrices
View matrices
4x4 perspective projection matrix.
4x4 perspective projection matrix, using width and height instead of the aspect ratio.
4x4 orthographic projection matrix.
Transformation matrices
Uniforms
type Uniforms3D = '[Transform3, Texture2] Source #