Skip to content

:shipit: Wavefront obj parser for Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

simnalamburt/obj-rs

Repository files navigation

obj-rs cargo-i travis-i

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

[dependencies]
obj-rs = "*"
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.

[dependencies]
obj-rs = { version = "*", features = ["glium-support"] }
use glium::*;
use obj::*;

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

About

:shipit: Wavefront obj parser for Rust

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages