Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Currently, you can parse a file and get a WavefrontOBJ
with the fromFile
function.
- data Location
- locX :: Location -> Float
- locY :: Location -> Float
- locZ :: Location -> Float
- locW :: Location -> Float
- data TexCoord
- texcoordR :: TexCoord -> Float
- texcoordS :: TexCoord -> Float
- texcoordT :: TexCoord -> Float
- data Normal
- norX :: Normal -> Float
- norY :: Normal -> Float
- norZ :: Normal -> Float
- data Point
- pointLocIndex :: Point -> Int
- data Line
- lineLocIndex :: LineIndex -> Int
- lineTexCoordIndex :: LineIndex -> Maybe Int
- data Face
- faceLocIndex :: FaceIndex -> Int
- faceTexCoordIndex :: FaceIndex -> Maybe Int
- faceNorIndex :: FaceIndex -> Maybe Int
- data Element a
- elObject :: Element a -> Maybe Text
- elGroups :: Element a -> [Text]
- elMtl :: Element a -> Maybe Text
- elValue :: Element a -> a
- data WavefrontOBJ = WavefrontOBJ {}
- module Codec.Wavefront.IO
Vertex location
A location is a 4-floating vector. You can access to its components by pattern matching on them:
let Location x y z w = Location 1 2 3 4
That type is strict and unboxed.
Vertex texture coordinates
A texture coordinate is a 3D-floating vector. You can access to its components by pattern matching on them:
let TexCoord r s t = TexCoord 0.1 0.2 0.3
That type is strcit and unboxed.
Vertex normals
A normal is a 3-floating vector. You can access to its components by pattern matching on them:
let Normal nx ny nz = Normal 0.1 0.2 0.3
That type is strict and unboxed.
Points
A point is a single index that references the locations. It’s a canonical type that truly represents a polygonal point.
pointLocIndex :: Point -> Int Source
Lines
lineLocIndex :: LineIndex -> Int Source
lineTexCoordIndex :: LineIndex -> Maybe Int Source
Faces
A face gathers several FaceIndex
to build up faces, arranged in either Triangle
, Quad
or
an arbritatry Polygon
.
faceLocIndex :: FaceIndex -> Int Source
faceTexCoordIndex :: FaceIndex -> Maybe Int Source
faceNorIndex :: FaceIndex -> Maybe Int Source
Element
An element holds a value along with the user-defined object’s name (if exists), the associated groups and the used material. Those values can be used to sort the data per object or per group and to lookup materials.
Object
Re-exports
module Codec.Wavefront.IO