Show normal vector in viewer example.

This commit is contained in:
Syoyo Fujita
2016-04-20 16:00:45 +09:00
parent 7399aedfdd
commit 58fa260605
5 changed files with 88 additions and 39 deletions

View File

@@ -79,12 +79,13 @@ Features
TODO
----
* [ ] Read .obj/.mtl from memory
* [ ] Read .obj/.mtl from memory.
* [ ] Fix Python binding.
License
-------
Licensed under 2 clause BSD.
Licensed under MIT license.
Usage
-----
@@ -94,11 +95,12 @@ Usage
#include "tiny_obj_loader.h"
std::string inputfile = "cornell_box.obj";
tinyobj::attrib_t attrib;
std::vector<tinyobj::shape_t> shapes;
std::vector<tinyobj::material_t> materials;
std::string err;
bool ret = tinyobj::LoadObj(shapes, materials, err, inputfile.c_str());
bool ret = tinyobj::LoadObj(&attrib, &shapes, &materials, &err, inputfile.c_str());
if (!err.empty()) { // `err` may contain warning message.
std::cerr << err << std::endl;