diff --git a/README.md b/README.md index da4afb4..3a021b8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ ObjLoader [![Build status](https://ci.appveyor.com/api/projects/status/5dbqtlt7gxninwyn?svg=true)](https://ci.appveyor.com/project/ChrisJansson/objloader)[![NuGet version](https://badge.fury.io/nu/CjClutter.ObjLoader.svg)](https://badge.fury.io/nu/CjClutter.ObjLoader) ======== - -Objloader is a simple Wavefront .obj and .mtl loader +Objloader is a simple Wavefront .obj and .mtl loader. Installation ------------ @@ -9,30 +8,34 @@ Build the project and reference the .dll or reference the project directly as us Loading a model --------------- -Either create the loader with the standard material stream provider, this will open the file read-only from the working directory. - - var objLoaderFactory = new ObjLoaderFactory(); - var objLoader = objLoaderFactory.Create(); +Either create the loader with the standard material stream provider, this will open the file read-only from the working directory. +```cs +var objLoaderFactory = new ObjLoaderFactory(); +var objLoader = objLoaderFactory.Create(); +``` Or provide your own: - - //With the signature Func - var objLoaderFactory = new ObjLoaderFactory(); - var objLoader = objLoaderFactory.Create(materialFileName => File.Open(materialFileName); +```cs +//With the signature Func +var objLoaderFactory = new ObjLoaderFactory(); +var objLoader = objLoaderFactory.Create(materialFileName => File.Open(materialFileName); +``` Then it is just a matter of invoking the loader with a stream containing the model. - - var fileStream = new FileStream("model.obj"); - var result = objLoader.Load(fileStream); +```cs +var fileStream = new FileStream("model.obj"); +var result = objLoader.Load(fileStream); +``` The result object contains the loaded model in this form: - - public class LoadResult - { - public IList Vertices { get; set; } - public IList Textures { get; set; } - public IList Normals { get; set; } - public IList Groups { get; set; } - public IList Materials { get; set; } - } +```cs +public class LoadResult +{ + public IList Vertices { get; set; } + public IList Textures { get; set; } + public IList Normals { get; set; } + public IList Groups { get; set; } + public IList Materials { get; set; } +} +```