Type structure
simnalamburt opened this issue · comments
Goals
- Ease of use
- Beauty
- SIMD aware
Low-level API
Low-level API provides one-to-one correspondent rust binding of obj format.
Obj
name ← String
required mtl files ← Vecvertices ← Vec
texture coordinates ← Vec
normals ← Vec
parametric vertices ← Vecpoints ← Vec
lines ← Vec
polygons ← Vecgroups ← HashMap<String, Group>
meshes ← HashMap<String, Group>
smoothing_groups ← VecMap
merging_groups ← VecMap
Other types
Point ← index of vertex
Line ← [(index of vertex); 2]
Line ← [(index of vertex, index of texture coordinate); 2]Polygon ← Vec
Polygon ← Vec<(index of vertex, index of texture coordinate)>
Polygon ← Vec<(index of vertex, index of normal)>
Polygon ← Vec<(index of vertex, index of texture coordinate, index of normal)>Group
points ← Vec
lines ← Vec
polygon ← VecRange
start ← uint
end ← uint
Current version of Rust doesn't support non-power-of-2 simd type
High-level API
High-level API wraps low-level API and makes it easy to interoperate with OpenGL. It triangulates polygons, normalizes indices, etc.