frenchtoast747 / webgl-obj-loader

A simple OBJ model loader to help facilitate the learning of WebGL.
http://frenchtoast747.github.io/webgl-obj-loader/
MIT License
281 stars 59 forks source link

Add calculation of tangents and bitangents #49

Closed novalain closed 6 years ago

novalain commented 6 years ago

Calculate tangents and bitangents in mesh class (useful for setting up the TBN matrix when dealing with bump maps). Method from: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-13-normal-mapping/ Resolves #49

Still TODO: Check handedness. UV's might be oriented in a wrong way (could be the case when dealing with symmetric models).

frenchtoast747 commented 6 years ago

The changes look good. Thanks for your contribution!