Versions in this module Expand all Collapse all v0 v0.0.1 Jun 22, 2021 Changes in this version + const CLAMP_TO_EDGE + const ChunkBIN + const ChunkJSON + const LINEAR + const LINEAR_MIPMAP_LINEAR + const LINEAR_MIPMAP_NEAREST + const LINES + const LINE_LOOP + const LINE_STRIP + const MIRRORED_REPEAT + const NEAREST + const NEAREST_MIPMAP_LINEAR + const NEAREST_MIPMAP_NEAREST + const POINTS + const REPEAT + const TRIANGLES + const TRIANGLE_FAN + const TRIANGLE_STRIP + func ReadGLB(r io.Reader) (json, bin []byte, err error) + func WriteGLB(w io.Writer, json, bin []byte) (err error) + type Accessor struct + BufferView uint32 + ByteOffset uint32 + ComponentType ComponentType + Count uint32 + Max []float32 + Min []float32 + Sparse ... + Type DataType + func (a Accessor) NumElemBytes() uint32 + func (a Accessor) NumTotalBytes() uint32 + type Animation struct + AniSamplers []AnimationSampler + Channels []AnimationChannel + Name string + type AnimationChannel struct + AniSampler uint32 + Target AnimationTarget + type AnimationSampler struct + Interpolation string + KeyTimes uint32 + KeyValues uint32 + type AnimationTarget struct + Node uint32 + Path string + type Asset struct + Copyright string + Generator string + Version string + type Attributes struct + COLOR_0 *uint32 + COLOR_1 *uint32 + COLOR_2 *uint32 + COLOR_3 *uint32 + JOINTS_0 *uint32 + JOINTS_1 *uint32 + JOINTS_2 *uint32 + JOINTS_3 *uint32 + NORMAL *uint32 + POSITION *uint32 + TANGENT *uint32 + TEXCOORD_0 *uint32 + TEXCOORD_1 *uint32 + TEXCOORD_2 *uint32 + TEXCOORD_3 *uint32 + WEIGHTS_0 *uint32 + WEIGHTS_1 *uint32 + WEIGHTS_2 *uint32 + WEIGHTS_3 *uint32 + type Buffer struct + ByteLength uint32 + Name string + URI string + func (b Buffer) IsExternal() bool + type BufferView struct + Buffer uint32 + ByteLength uint32 + ByteOffset uint32 + ByteStride *uint32 + Name string + Target *uint32 + type Camera struct + Name string + Orthographic ... + Perspective ... + Type string + type ComponentType uint32 + const BYTE + const FLOAT + const SHORT + const UNSIGNED_BYTE + const UNSIGNED_INT + const UNSIGNED_SHORT + func (t *ComponentType) UnmarshalJSON(b []byte) error + func (t ComponentType) MarshalJSON() ([]byte, error) + func (t ComponentType) NumBytes() uint32 + func (t ComponentType) String() string + type DataType uint32 + const MAT2 + const MAT3 + const MAT4 + const SCALAR + const VEC2 + const VEC3 + const VEC4 + func (a *DataType) UnmarshalJSON(b []byte) error + func (a DataType) MarshalJSON() ([]byte, error) + func (a DataType) NumBytes() uint32 + func (a DataType) String() string + type GLTF struct + Accessors []*Accessor + Animations []*Animation + Asset Asset + BIN []byte + BufferViews []*BufferView + Buffers []*Buffer + Cameras []*Camera + ExtensionsRequired []string + ExtensionsUsed []string + Images []*Image + Materials []*Material + Meshes []*Mesh + Nodes []*Node + Samplers []*Sampler + Scene *uint32 + Scenes []*Scene + Skins []*Skin + Textures []*Texture + func Decode(jsonChunk, binChunk []byte) (p *GLTF, err error) + func ReadDecodeGLB(r io.Reader) (p *GLTF, err error) + func (p *GLTF) ReadAccessor(i uint32) (data []byte, stride uint32, a *Accessor, err error) + func (p *GLTF) ReadBuffer(i uint32) (data []byte, mime string, err error) + func (p *GLTF) ReadBufferView(i uint32) (data []byte, mime string, bv *BufferView, err error) + func (p *GLTF) ReadImage(i uint32) (data []byte, mime string, img *Image, err error) + type Image struct + BufferView *uint32 + MimeType string + Name string + URI string + type KHR_materials_clearcoat struct + ClearcoatFactor float32 + ClearcoatNormalTexture *NormalTextureInfo + ClearcoatRoughnessFactor float32 + ClearcoatRoughnessTexture *TextureInfo + ClearcoatTexture *TextureInfo + type KHR_materials_pbrSpecularGlossiness struct + DiffuseFactor *[4]float32 + DiffuseTexture TextureInfo + GlossinessFactor *float32 + SpecularFactor *[3]float32 + SpecularGlossinessTexture TextureInfo + type KHR_materials_unlit struct + type Material struct + AlphaCutoff *float32 + AlphaMode string + DoubleSided bool + EmissiveFactor [3]float32 + EmissiveTexture *TextureInfo + Extensions struct{ ... } + Name string + NormalTexture *NormalTextureInfo + OcclusionTexture *OcclusionTextureInfo + PbrMetallicRoughness ... + type Matrix [16]float32 + type Mesh struct + Name string + Primitives []Primitive + Weights []float32 + type MorphTarget struct + NORMAL *uint32 + POSITION *uint32 + TANGENT *uint32 + type Node struct + Camera *uint32 + Children []uint32 + Matrix *Matrix + Mesh *uint32 + Name string + Rotation *Rotation + Scale *Scale + Skin *uint32 + Translation *Translation + type NormalTextureInfo struct + Index uint32 + Scale *float32 + TexCoord uint32 + type OcclusionTextureInfo struct + Index uint32 + Strength *float32 + TexCoord uint32 + type Primitive struct + Attributes Attributes + Indices *uint32 + Material *uint32 + Mode *uint32 + Targets []MorphTarget + type Rotation [4]float32 + type Sampler struct + MagFilter uint32 + MinFilter uint32 + WrapS uint32 + WrapT uint32 + type Scale [3]float32 + type Scene struct + Name string + Nodes []uint32 + type Skin struct + InverseBindMatrices *uint32 + Joints []uint32 + Name string + Skeleton *uint32 + type Texture struct + Name string + Sampler *uint32 + Source *uint32 + type TextureInfo struct + Index uint32 + TexCoord uint32 + type Translation [3]float32