[Wavefront .obj] parser for Rust. It handles both .obj
and .mtl
formats.
See [Documentation] for the further details.
toml
[dependencies]
obj-rs = "0.5"
```rust
use std::fs::File;
use std::io::BufReader;
use obj::*;
let input = BufReader::new(File::open("tests/fixtures/dome.obj"))?; let mobel: Obj = load_obj(input)?;
// Do whatever you want model.vertices; model.indices; ```
obj-rs supports [glium] out of the box.
toml
[dependencies]
glium = "0.14"
obj-rs = { version = "0.5", features = ["glium-support"] }
```rust
use std::fs::File;
use std::io::BufReader;
use obj::*;
let input = BufReader::new(try!(File::open("rilakkuma.obj"))); let obj: Obj = try!(load_obj(input));
let vb = try!(obj.vertexbuffer(&display)); let ib = try!(obj.indexbuffer(&display)); ```
Please see the [working sample] for the further details. Use can execute it with
the command below.
bash
cargo run --example glium --features glium-support
Linux/macOS Build | Windows Build :----------------:|:-------------: ![Travis Build Status] | ![AppVeyor Build Status]
obj-rs is primarily distributed under the terms of both the [Apache License (Version 2.0)] and the [MIT license]. See [COPYRIGHT] for details.