Created
November 3, 2015 11:34
-
-
Save TheOpenDevProject/efa0bb2499bcdaa79292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Basic stuff for our Xorg window | |
| extern crate gl; | |
| extern crate glutin; | |
| extern crate libc; | |
| use std::str::CharRange; | |
| use std::error::Error; | |
| use std::io::prelude::*; | |
| use std::fs::File; | |
| use std::path::Path; | |
| struct Vec3D{ | |
| X:f32, | |
| Y:f32, | |
| Z:f32 | |
| } | |
| fn main() { | |
| load_file(); | |
| } | |
| fn load_file(){ | |
| let model_path = Path::new("/media/reverseinverse/Data/models/model.obj"); | |
| let mut file = match File::open(&model_path) { | |
| Err(err_msg) => panic!("Could not load model"), | |
| Ok(file) => file, | |
| }; | |
| let mut file_content = String::new(); | |
| //Break up the object file for further processin | |
| match file.read_to_string(&mut file_content){ | |
| Err(why) => panic!("Cant read file"), | |
| Ok(_) => print!("File Read OK!"), | |
| } | |
| let mut model_split = file_content.split("\r\n"); | |
| #![feature(str_char, core)] | |
| for line in model_split { | |
| let CharIttr = {ch, next} = line.char_range_at(0); | |
| if(ch == "v"){ | |
| print!("Line = {}\r\n",line); | |
| } | |
| } | |
| } |
Author
TheOpenDevProject
commented
Nov 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment