https://github.com/simnalamburt/obj-rs
:shipit: Wavefront obj parser for Rust
https://github.com/simnalamburt/obj-rs
crates glium rust wavefront
Last synced: 2 months ago
JSON representation
:shipit: Wavefront obj parser for Rust
- Host: GitHub
- URL: https://github.com/simnalamburt/obj-rs
- Owner: simnalamburt
- License: other
- Created: 2014-12-09T17:30:24.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-03-24T07:22:30.000Z (3 months ago)
- Last Synced: 2025-04-01T18:13:57.975Z (2 months ago)
- Topics: crates, glium, rust, wavefront
- Language: Rust
- Homepage: https://docs.rs/obj-rs
- Size: 1.15 MB
- Stars: 80
- Watchers: 4
- Forks: 36
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
obj-rs [![version]][crates.io]
========
[Wavefront .obj] parser for Rust. It handles both `.obj` and `.mtl` formats.
See [Documentation] for the further details.```toml
[dependencies]
obj-rs = "0.7"
```
```rust
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;
```
Glium support
--------
**obj-rs** supports [glium] out of the box.```toml
[dependencies]
glium = "0.35"
obj-rs = { version = "0.7", features = ["glium"] }
```
```rust
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.
```bash
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.[version]: https://badgen.net/crates/v/obj-rs
[crates.io]: https://crates.io/crates/obj-rs[Wavefront .obj]: https://en.wikipedia.org/wiki/Wavefront_.obj_file
[Documentation]: https://docs.rs/obj-rs/
[glium]: https://github.com/tomaka/glium
[working sample]: sampleapp/src/main.rs[MIT license]: LICENSE-MIT
[Apache License (Version 2.0)]: LICENSE-APACHE
[COPYRIGHT]: COPYRIGHT