License | MIT |
---|---|
Maintainer | Jonatan H Sundqvist |
Stability | experimental|stable |
Portability | POSIX (not sure) |
Safe Haskell | None |
Language | Haskell2010 |
- data OBJToken f s i m
- data VertexIndices i = VertexIndices {
- fIvertex :: i
- fItexcoord :: Maybe i
- fInormal :: Maybe i
- type OBJ f s i m = m (OBJToken f s i m)
- data MTLToken f s
- = Ambient (Colour f)
- | Diffuse (Colour f)
- | Specular (Colour f)
- | SpecularExponent f
- | Illum Illumination
- | Dissolve f
- | Refraction f
- | MapDiffuse s
- | MapAmbient s
- | NewMaterial s
- type Illumination = Int
- type MTL f s m = m (MTLToken f s)
- type MTLTable f s = Map s (Map s (Material f s))
- type Vertices f m = m (V3 f)
- type TexCoords f m = m (Maybe (V2 f))
- type Normals f m = m (Maybe (V3 f))
- type Materials f s m = m (Material f s)
- data Face f s i m = Face {
- fIndices :: m (VertexIndices i)
- fMaterial :: Material f s
- data Colour f = Colour {}
- data Material f s = Material {}
- data Model f s i m = Model {}
Documentation
data OBJToken f s i m Source #
Represents a single (valid) OBJ token
TODO | - Polymorphic numerical types (?) - Add context, metadata (eg. line numbers, filename) (?) - Naming scheme (added OBJ prefix to prevent name clashes; cf. Face type) - Comment token (preserve comments in parser output or remove them) (?)
- Cover the entire spec (http:/www.martinreddy.netgfx3dOBJ.spec) (and handle unimplemented attributes gracefully)
data VertexIndices i Source #
TODO: Rename (?) TODO: Use union instead of Maybe (?)
VertexIndices | |
|
Eq i => Eq (VertexIndices i) Source # | |
Show i => Show (VertexIndices i) Source # | |
HasIvertex (VertexIndices i0) i0 Source # | |
HasItexcoord (VertexIndices i0) (Maybe i0) Source # | |
HasInormal (VertexIndices i0) (Maybe i0) Source # | |
HasIndices (Face f0 s0 i0 m0) (m0 (VertexIndices i0)) Source # | |
type OBJ f s i m = m (OBJToken f s i m) Source #
Output type of the OBJ parser.
TODO | - Rename (?) - Use Integral for line number (?)
Represents a single (valid) MTL token
TODO | - Is the alpha channel optional, ignored, disallowed?
- Include support for (Ns
, Ni
, d
, Tr
, illum
)
- Assume no colours have an alpha channel, since transparency is handled by the d
attribute (?)
Ambient (Colour f) | |
Diffuse (Colour f) | |
Specular (Colour f) | |
SpecularExponent f | |
Illum Illumination | |
Dissolve f | |
Refraction f | |
MapDiffuse s | |
MapAmbient s | |
NewMaterial s |
type Illumination = Int Source #
- Color on and Ambient off
- Color on and Ambient on
- Highlight on
- Reflection on and Ray trace on
- Transparency: Glass on, Reflection: Ray trace on
- Reflection: Fresnel on and Ray trace on
- Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
- Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
- Reflection on and Ray trace off
- Transparency: Glass on, Reflection: Ray trace off
- Casts shadows onto invisible surfaces
type MTL f s m = m (MTLToken f s) Source #
Output type of the MTL parser. Currently a list of line number and token (or error string) pairs TODO | - Add type for processed MTL (eg. a map between names and materials)
TODO | - Validation (eg. length ivertices == length == ivertices == length itextures if length isn't 0) - Pack indices in a tuple (eg. indices :: [(Int, Int, Int)]) (?) - Use (String, String) for the names of the mtl file and material instead of Material (?) - Use types so as not to confuse the indices (eg. newtype INormal, newtype ITexcoord)
Face | |
|
(Show1 m, Show (m f), Show (m (VertexIndices i)), Show (m (V3 f)), Show (m s), Show f, Show s, Show i) => Show (Face f s i m) Source # | |
HasIndices (Face f0 s0 i0 m0) (m0 (VertexIndices i0)) Source # | |
HasFaces (Model f0 s0 i0 m0) (m0 (Face f0 s0 i0 m0)) Source # | |
HasMaterial (Face f0 s0 i0 m0) (Material f0 s0) Source # | |
TODO | - Use a type from the colour package instead (?)
Functor Colour Source # | |
Foldable Colour Source # | |
Eq f => Eq (Colour f) Source # | |
Show f => Show (Colour f) Source # | |
HasRed (Colour f0) f0 Source # | |
HasGreen (Colour f0) f0 Source # | |
HasBlue (Colour f0) f0 Source # | |
HasAlpha (Colour f0) f0 Source # | |
HasSpecular (Material f0 s0) (Colour f0) Source # | |
HasDiffuse (Material f0 s0) (Colour f0) Source # | |
HasAmbient (Material f0 s0) (Colour f0) Source # | |
TODO | - Do all materials have an ambient, a diffuse and a specular colour (?) - Support more attributes (entire spec) (?) - Lenses (?)
(Eq f, Eq s) => Eq (Material f s) Source # | |
(Show f, Show s) => Show (Material f s) Source # | |
HasTexture (Material f0 s0) (Maybe s0) Source # | |
HasSpecular (Material f0 s0) (Colour f0) Source # | |
HasDiffuse (Material f0 s0) (Colour f0) Source # | |
HasAmbient (Material f0 s0) (Colour f0) Source # | |
HasMaterial (Face f0 s0 i0 m0) (Material f0 s0) Source # | |
HasMaterials (Model f0 s0 i0 m0) (MTLTable f0 s0) Source # | |
Abstract representation of an OBJ model with associated MTL definitions.
TODO | - Rename (?) - Include metadata, comments, rejected data (?) - Separate type for processed OBJTokens (ie. token + context) - Perform index lookups (?) - Reconsider the types (especially of the materials) - Rename accessor functions (eg. texcoords instead of textures) (?)
fTextures :: Set s, data Model f s i m = Model {
(Show1 m, Show (m f), Show (m (V2 f)), Show (m (V3 f)), Show (m (Face f s i m)), Show (m s), Show f, Show s, Show i) => Show (Model f s i m) Source # | |
HasVertices (Model f0 s0 i0 m0) (m0 (V3 f0)) Source # | |
HasTexcoords (Model f0 s0 i0 m0) (m0 (V2 f0)) Source # | |
HasRoot (Model f0 s0 i0 m0) (Maybe FilePath) Source # | |
HasNormals (Model f0 s0 i0 m0) (m0 (V3 f0)) Source # | |
HasFaces (Model f0 s0 i0 m0) (m0 (Face f0 s0 i0 m0)) Source # | |
HasObjects (Model f0 s0 i0 m0) (Map (Set s0) (i0, i0)) Source # | |
HasMaterials (Model f0 s0 i0 m0) (MTLTable f0 s0) Source # | |
HasGroups (Model f0 s0 i0 m0) (Map (Set s0) (i0, i0)) Source # | |