Skip to content

iskim517/obj-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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]
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

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%