importers

package
v0.0.0-...-90c1326 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseVector3

func ParseVector3(values []string) ([3]float64, error)

ParseVector3 converts string values to a 3D vector

Types

type Material

type Material struct {
	Name          string
	AmbientColor  [3]float64
	DiffuseColor  [3]float64
	SpecularColor [3]float64
	Shininess     float64
	DiffuseMap    string
	NormalMap     string
	SpecularMap   string
	Transparency  float64
}

Material represents material properties for 3D models

type MaterialImporter

type MaterialImporter struct {
	// contains filtered or unexported fields
}

MaterialImporter handles importing materials from different 3D model formats

func NewMaterialImporter

func NewMaterialImporter() *MaterialImporter

NewMaterialImporter creates a new material importer instance

func (*MaterialImporter) GetMaterial

func (mi *MaterialImporter) GetMaterial(name string) (*Material, bool)

GetMaterial returns a material by name

func (*MaterialImporter) GetMaterials

func (mi *MaterialImporter) GetMaterials() map[string]*Material

GetMaterials returns all imported materials

func (*MaterialImporter) ImportFromFBX

func (mi *MaterialImporter) ImportFromFBX(reader io.Reader) error

ImportFromFBX imports materials from FBX format

func (*MaterialImporter) ImportFromOBJ

func (mi *MaterialImporter) ImportFromOBJ(reader io.Reader) error

ImportFromOBJ imports materials from MTL format (OBJ materials)

type Vertex

type Vertex struct {
	Position  [3]float64
	Normal    [3]float64
	TexCoords [2]float64
}

Vertex represents a 3D vertex with position, normal, and texture coordinates

type VertexImporter

type VertexImporter struct {
	// contains filtered or unexported fields
}

VertexImporter handles importing vertices from different 3D model formats

func NewVertexImporter

func NewVertexImporter() *VertexImporter

NewVertexImporter creates a new vertex importer instance

func (*VertexImporter) GetVertices

func (vi *VertexImporter) GetVertices() []Vertex

GetVertices returns the imported vertices

func (*VertexImporter) ImportFromFBX

func (vi *VertexImporter) ImportFromFBX(reader io.Reader) error

ImportFromFBX imports vertices from FBX format

func (*VertexImporter) ImportFromOBJ

func (vi *VertexImporter) ImportFromOBJ(reader io.Reader) error

ImportFromOBJ imports vertices from OBJ format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL