obj-rs 0.4.3

Wavefront obj parser for Rust. It handles both 'obj' and 'mtl' formats.
docs.rs failed to build obj-rs-0.4.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: obj-rs-0.7.1

obj-rs cargo-i travis-i

Wavefront obj parser for Rust. It handles both .obj and .mtl formats. Documentation

[dependencies.obj-rs]
git = "https://github.com/simnalamburt/obj-rs"
features = ["glium-support"]
use std::fs::File;
use std::io::BufReader;
use obj::*;

let input = BufReader::new(File::open("tests/fixtures/dome.obj").unwrap());
let dome: Obj = load_obj(input).unwrap();

// Do whatever you want
dome.vertices;
dome.indices;

img

This sample image is pretty good illustration of current status of obj-rs. obj-rs is currently able to load position and normal data of obj but not texture & material data yet.

Glium support

obj-rs supports glium out of the box. See example for further details.

use glium::*;

let input = BufReader::new(File::open("rilakkuma.obj").unwrap());
let bear: Obj = load_obj(input).unwrap();

let vertex_buffer = VertexBuffer::new(&display, bear.vertices);
let index_buffer = IndexBuffer::new(&display, index::TrianglesList(bear.indices));

BSD 2-Clause