Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct { Objects []Object // decoded objects Matlib string // name of the material lib Materials map[string]*Material // maps material name to object Vertices math32.ArrayF32 // vertices positions array Normals math32.ArrayF32 // vertices normals Uvs math32.ArrayF32 // vertices texture coordinates Warnings []string // warning messages // contains filtered or unexported fields }
Decoder contains all decoded data from the obj and mtl files
func Decode ¶
Decode decodes the specified obj and mtl files returning a decoder object and an error.
func DecodeReader ¶
DecodeReader decodes the specified obj and mtl readers returning a decoder object and an error.
func (*Decoder) NewGeometry ¶
NewGeometry generates and returns a geometry from the specified object
type Face ¶
type Face struct { Vertices []int // Indices to the face vertices Uvs []int // Indices to the face UV coordinates Normals []int // Indices to the face normals Material string // Material name Smooth bool // Smooth face }
Face contains all information about an object face
type Material ¶
type Material struct { Name string // Material name Illum int // Illumination model Opacity float32 // Opacity factor Refraction float32 // Refraction factor Shininess float32 // Shininess (specular exponent) Ambient math32.Color // Ambient color reflectivity Diffuse math32.Color // Diffuse color reflectivity Specular math32.Color // Specular color reflectivity Emissive math32.Color // Emissive color MapKd string // Texture file linked to diffuse color }
Material contains all information about an object material
Click to show internal directories.
Click to hide internal directories.