{"action":"closed","issue":{"url":"https://api.github.com/repos/syoyo/tinyobjloader/issues/140","repository_url":"https://api.github.com/repos/syoyo/tinyobjloader","labels_url":"https://api.github.com/repos/syoyo/tinyobjloader/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/syoyo/tinyobjloader/issues/140/comments","events_url":"https://api.github.com/repos/syoyo/tinyobjloader/issues/140/events","html_url":"https://github.com/syoyo/tinyobjloader/issues/140","id":260056894,"number":140,"title":"Incorrect .obj loading","user":{"login":"matanui159","id":5038541,"avatar_url":"https://avatars0.githubusercontent.com/u/5038541?v=4","gravatar_id":"","url":"https://api.github.com/users/matanui159","html_url":"https://github.com/matanui159","followers_url":"https://api.github.com/users/matanui159/followers","following_url":"https://api.github.com/users/matanui159/following{/other_user}","gists_url":"https://api.github.com/users/matanui159/gists{/gist_id}","starred_url":"https://api.github.com/users/matanui159/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matanui159/subscriptions","organizations_url":"https://api.github.com/users/matanui159/orgs","repos_url":"https://api.github.com/users/matanui159/repos","events_url":"https://api.github.com/users/matanui159/events{/privacy}","received_events_url":"https://api.github.com/users/matanui159/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-09-24T04:22:54Z","updated_at":"2017-09-24T06:01:38Z","closed_at":"2017-09-24T06:01:38Z","author_association":"NONE","body":"Using the sample OBJ:\r\n```\r\nmtllib test.mtl\r\n\r\nv -0.5 -0.5 0\r\nv 0.5 -0.5 0\r\nv 0.5 0.5 0\r\nv -0.5 0.5 0\r\n\r\nvt 0 0 0\r\nvt 1 0 0\r\nvt 1 1 0\r\nvt 0 1 0\r\n\r\nvn 0 0 -1\r\n\r\nusemtl main\r\nf 0/0/0 1/1/0 3/3/0\r\nf 1/1/0 3/3/0 2/2/0\r\n```\r\n\r\nwith the sample MTL:\r\n```\r\nnewmtl main\r\nKd 1 1 1\r\n```\r\n\r\nand the sample code:\r\n```c++\r\n ...\r\ntinyobj::attrib_t attrib;\r\nstd::vector<tinyobj::shape_t> shapes;\r\nstd::vector<tinyobj::material_t> materials;\r\nstd::string error;\r\ntinyobj::LoadObj(&attrib, &shapes, &materials, &error, argv[2]);\r\nif (!error.empty()) throw error;\r\n ...\r\nstd::cout << \"VERTICES:\" << std::endl;\r\nfor (float x : attrib.vertices) {\r\n\tstd::cout << x << std::endl;\r\n}\r\nstd::cout << std::endl;\r\n\r\nstd::cout << \"NORMALS:\" << std::endl;\r\nfor (float x : attrib.normals) {\r\n\tstd::cout << x << std::endl;\r\n}\r\nstd::cout << std::endl;\r\n\r\nstd::cout << \"TEXCOORDS:\" << std::endl;\r\nfor (float x : attrib.texcoords) {\r\n\tstd::cout << x << std::endl;\r\n}\r\nstd::cout << std::endl;\r\n\r\nstd::cout << \"FACES:\" << std::endl;\r\nfor (tinyobj::shape_t& x : shapes) {\r\n\tfor (unsigned char y : x.mesh.num_face_vertices) {\r\n\t\tstd::cout << (int)y << std::endl;\r\n\t}\r\n}\r\nstd::cout << std::endl;\r\n\r\nstd::cout << \"INDICES:\" << std::endl;\r\nfor (tinyobj::shape_t& x : shapes) {\r\n\tfor (tinyobj::index_t y : x.mesh.indices) {\r\n\t\tstd::cout << y.vertex_index << \"/\" << y.texcoord_index << \"/\" << y.normal_index << std::endl;\r\n\t}\r\n}\r\nstd::cout << std::endl;\r\n ...\r\n```\r\n\r\nthe following is produced:\r\n```\r\nVERTICES:\r\n-0.5\r\n-0.5\r\n0\r\n0.5\r\n-0.5\r\n0\r\n0.5\r\n0.5\r\n0\r\n-0.5\r\n0.5\r\n0\r\n\r\nNORMALS:\r\n0\r\n0\r\n-1\r\n\r\nTEXCOORDS:\r\n0\r\n0\r\n1\r\n0\r\n1\r\n1\r\n0\r\n1\r\n\r\nFACES:\r\n3\r\n3\r\n\r\nINDICES:\r\n0/0/0\r\n0/0/0\r\n2/2/0\r\n0/0/0\r\n2/2/0\r\n1/1/0\r\n```\r\n\r\nwhere the indices are incorrect. The same occurs when disabling triangulation. I've looked through previous issues but couldn't find anything. I am using release v1.0.6."}}
{"actor":{"display_login":"matanui159"}}