Documentation ¶
Overview ¶
Structures used to represent 3D scenes (imported using Open Asset Importer).
This file contains the strucutres used in the program
Index ¶
Constants ¶
const ( // All indexes are under 255 ByteSize IndexSize = 255 // All indexes are under 65536 ShortSize = 32767 // Fall back IntSize = 2147483647 )
const (
ErrMeshNotFound = Error("Unable to find the given mesh in the Scene")
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Face ¶
type Face struct { // List of vector indices Indices []int }
Hold the information of a single face. Hold only the pointers to the vector stored in the Mesh
type FlatMesh ¶
type FlatMesh struct { Vertex []float32 Normal []float32 Color []float32 Texture []float32 Index []uint32 }
This structure is optimized to be used with OpenGL. The vertex information is flat and can be passed directly to OpenGL API.
Vertex and Normals are 3 components (x,y,z)
Colors are 4 components (r,g,b,a)
Face index can be a list of: int8 or int16 or int (usually it's int16), this is used to reduce the amount of data sent to the VRAM, the user must check the value of index size to discover that property should be used
32 bit floats are used instead of 64 since most of the time 32 bit's have enough space to hold most geometries
func NewFlatMesh ¶
Return a flat representation of the given mesh
func (*FlatMesh) FillIndexArray ¶
Return a copy of the mesh index array with elements of the size informed.
No overflow is checked, so if you request the ByteSize and there are indexes with values greater than 255, the value will be truncated and the mesh will be deformed.
type Mesh ¶
type Mesh struct { // List of vertices Vertices []Vector3 // List of normals Normals []Vector3 // List of colors Colors []Vector4 // List of faces Faces []*Face // List of UV Coordinates (at this point, only one texture for each mesh) UVCoords []Vector2 // contains filtered or unexported fields }
Hold the Mesh information Vertices, Textures and Normals
func (*Mesh) HasNormals ¶
Return true if the mesh has normal information
type Node ¶
type Node struct { // The list of index used by this node Mesh []int // Child nodes Childs []*Node }
One node in the scene.
Directories ¶
Path | Synopsis |
---|---|
Open Asset Importer This application uses the OpenAssetLibrary to import a scene and output's a gob encoded structure (see github.com/andrebq/assimp) that can be further manipulated using just go whithout the need for cgo packages.
|
Open Asset Importer This application uses the OpenAssetLibrary to import a scene and output's a gob encoded structure (see github.com/andrebq/assimp) that can be further manipulated using just go whithout the need for cgo packages. |
Hold the routines used to convert from C structures to the Go ones This package is a wrapper for the Open Asset Importer library (http://assimp.sourceforge.net/).
|
Hold the routines used to convert from C structures to the Go ones This package is a wrapper for the Open Asset Importer library (http://assimp.sourceforge.net/). |
Functions to write 3D scenes to disk The only supported format right now is gob, so in order to load/save data you must also import the assimp library.
|
Functions to write 3D scenes to disk The only supported format right now is gob, so in order to load/save data you must also import the assimp library. |