| Crates.io | obj-rs |
| lib.rs | obj-rs |
| version | 0.7.4 |
| created_at | 2014-12-05 12:17:58.565644+00 |
| updated_at | 2024-09-28 15:28:55.141488+00 |
| description | Wavefront obj parser for Rust. It handles both 'obj' and 'mtl' formats. |
| homepage | https://github.com/simnalamburt/obj-rs |
| repository | https://github.com/simnalamburt/obj-rs |
| max_upload_size | |
| id | 461 |
| size | 4,608,241 |
Wavefront .obj parser for Rust. It handles both .obj and .mtl formats.
See Documentation for the further details.
[dependencies]
obj-rs = "0.7"
use std::fs::File;
use std::io::BufReader;
use obj::{load_obj, Obj};
let input = BufReader::new(File::open("tests/fixtures/dome.obj"))?;
let model: Obj = load_obj(input)?;
// Do whatever you want
model.vertices;
model.indices;
obj-rs supports glium out of the box.
[dependencies]
glium = "0.26"
obj-rs = { version = "0.6", features = ["glium"] }
use std::fs::File;
use std::io::BufReader;
use obj::{load_obj, Obj};
let input = BufReader::new(File::open("rilakkuma.obj")?);
let obj: Obj = load_obj(input)?;
let vb = obj.vertex_buffer(&display)?;
let ib = obj.index_buffer(&display)?;
Please see the working sample for the further details. Use can execute it with the command below.
cargo run -p sampleapp
obj-rs is primarily distributed under the terms of both the Apache License (Version 2.0) and the MIT license. See COPYRIGHT for details.