wavefront-0.7.1.5: Wavefront OBJ loader
Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Codec.Wavefront

Description

Currently, you can parse a file and get a WavefrontOBJ with the fromFile function.

Synopsis

Vertex location

data Location Source #

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.

Constructors

Location 

Fields

Instances

Instances details
Show Location Source # 
Instance details

Defined in Codec.Wavefront.Location

Eq Location Source # 
Instance details

Defined in Codec.Wavefront.Location

Vertex texture coordinates

data TexCoord Source #

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.

Constructors

TexCoord 

Instances

Instances details
Show TexCoord Source # 
Instance details

Defined in Codec.Wavefront.TexCoord

Eq TexCoord Source # 
Instance details

Defined in Codec.Wavefront.TexCoord

Vertex normals

data Normal Source #

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.

Constructors

Normal 

Fields

Instances

Instances details
Show Normal Source # 
Instance details

Defined in Codec.Wavefront.Normal

Eq Normal Source # 
Instance details

Defined in Codec.Wavefront.Normal

Methods

(==) :: Normal -> Normal -> Bool #

(/=) :: Normal -> Normal -> Bool #

Points

data Point Source #

A point is a single index that references the locations. It’s a canonical type that truly represents a polygonal point.

Constructors

Point 

Fields

Instances

Instances details
Show Point Source # 
Instance details

Defined in Codec.Wavefront.Point

Methods

showsPrec :: Int -> Point -> ShowS #

show :: Point -> String #

showList :: [Point] -> ShowS #

Eq Point Source # 
Instance details

Defined in Codec.Wavefront.Point

Methods

(==) :: Point -> Point -> Bool #

(/=) :: Point -> Point -> Bool #

Lines

data Line Source #

Constructors

Line 

Instances

Instances details
Show Line Source # 
Instance details

Defined in Codec.Wavefront.Line

Methods

showsPrec :: Int -> Line -> ShowS #

show :: Line -> String #

showList :: [Line] -> ShowS #

Eq Line Source # 
Instance details

Defined in Codec.Wavefront.Line

Methods

(==) :: Line -> Line -> Bool #

(/=) :: Line -> Line -> Bool #

data LineIndex Source #

A line index is a pair of indices. LineIndex vi vti. vi references the locations and vti indexes the texture coordinates. If vti == Nothing, then that LineIndex doesn’t have texture coordinates associated with.

Constructors

LineIndex 

Instances

Instances details
Show LineIndex Source # 
Instance details

Defined in Codec.Wavefront.Line

Eq LineIndex Source # 
Instance details

Defined in Codec.Wavefront.Line

Faces

data Face Source #

A face gathers several FaceIndex to build up faces. It has a least three vertices

Instances

Instances details
Show Face Source # 
Instance details

Defined in Codec.Wavefront.Face

Methods

showsPrec :: Int -> Face -> ShowS #

show :: Face -> String #

showList :: [Face] -> ShowS #

Eq Face Source # 
Instance details

Defined in Codec.Wavefront.Face

Methods

(==) :: Face -> Face -> Bool #

(/=) :: Face -> Face -> Bool #

data FaceIndex Source #

A face index is a triplet of indices. FaceIndex vi vti vni is a face that indexes the locations with vi, the texture coordinates with vti and the normals with vni. An index set to Nothing means no information. That is, if vni == Nothing, then that FaceIndex doesn’t have a normal associated with.

Constructors

FaceIndex 

Instances

Instances details
Show FaceIndex Source # 
Instance details

Defined in Codec.Wavefront.Face

Eq FaceIndex Source # 
Instance details

Defined in Codec.Wavefront.Face

Element

data Element a Source #

An element holds a value along with the user-defined object’s name (if any), the associated groups, the used material and the smoothing group the element belongs to (if any). Those values can be used to sort the data per object or per group and to lookup materials.

Constructors

Element 

Instances

Instances details
Show a => Show (Element a) Source # 
Instance details

Defined in Codec.Wavefront.Element

Methods

showsPrec :: Int -> Element a -> ShowS #

show :: Element a -> String #

showList :: [Element a] -> ShowS #

Eq a => Eq (Element a) Source # 
Instance details

Defined in Codec.Wavefront.Element

Methods

(==) :: Element a -> Element a -> Bool #

(/=) :: Element a -> Element a -> Bool #

Object

data WavefrontOBJ Source #

Constructors

WavefrontOBJ 

Fields

Instances

Instances details
Show WavefrontOBJ Source # 
Instance details

Defined in Codec.Wavefront.Object

Eq WavefrontOBJ Source # 
Instance details

Defined in Codec.Wavefront.Object

Re-exports