Merge pull request #8955 from sethalves/fix-obj-textures

fix obj textures
This commit is contained in:
Chris Collins 2016-10-31 11:52:25 -07:00 committed by GitHub
commit a49669a975

View file

@ -123,7 +123,9 @@ glm::vec3 OBJTokenizer::getVec3() {
return v;
}
glm::vec2 OBJTokenizer::getVec2() {
auto v = glm::vec2(getFloat(), 1.0f - getFloat()); // OBJ has an odd sense of u, v. Also N.B.: getFloat() has side-effect
float uCoord = getFloat();
float vCoord = 1.0f - getFloat();
auto v = glm::vec2(uCoord, vCoord);
while (isNextTokenFloat()) {
// there can be a w, but we don't handle that
nextToken();