Expand description
Wavefront OBJ parser for Rust. It handles both .obj and .mtl formats. GitHub
use std::fs::File;
use std::io::BufReader;
use obj::{load_obj, Obj};
let input = BufReader::new(File::open("tests/fixtures/normal-cone.obj")?);
let dome: Obj = load_obj(input)?;
// Do whatever you want
dome.vertices;
dome.indices;
Modules
- Provides low-level API for Wavefront OBJ format.
Structs
- The error type for parse operations of the
Objstruct. - 3D model object loaded from wavefront OBJ.
- Vertex data type of
Objwhich contains only position data of a vertex. - Vertex data type of
Objwhich contains position, normal and texture data of a vertex. - Vertex data type of
Objwhich contains position and normal data of a vertex.
Enums
- Enum to store the various types of errors that can cause loading an OBJ to fail.
- The error type for loading of the
objfile.
Traits
- Conversion from
RawObj’s raw data.
Functions
- Load a wavefront OBJ file into Rust & OpenGL friendly format.
Type Definitions
- A type for results generated by
load_objandload_mtlwhere theErrtype is hard-wired toObjError