{"action":"created","issue":{"url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/27","repository_url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader","labels_url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/27/comments","events_url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/27/events","html_url":"https://github.com/frenchtoast747/webgl-obj-loader/issues/27","id":161069722,"number":27,"title":"cannot load .obj file","user":{"login":"melfnt","id":6087390,"avatar_url":"https://avatars.githubusercontent.com/u/6087390?v=3","gravatar_id":"","url":"https://api.github.com/users/melfnt","html_url":"https://github.com/melfnt","followers_url":"https://api.github.com/users/melfnt/followers","following_url":"https://api.github.com/users/melfnt/following{/other_user}","gists_url":"https://api.github.com/users/melfnt/gists{/gist_id}","starred_url":"https://api.github.com/users/melfnt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melfnt/subscriptions","organizations_url":"https://api.github.com/users/melfnt/orgs","repos_url":"https://api.github.com/users/melfnt/repos","events_url":"https://api.github.com/users/melfnt/events{/privacy}","received_events_url":"https://api.github.com/users/melfnt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-06-19T12:05:40Z","updated_at":"2016-06-20T19:27:18Z","closed_at":null,"body":"Hi everyone, I'm a noob in 3D graphics. I tried to load the model I attach\r\n[bb8.obj.zip](https://github.com/frenchtoast747/webgl-obj-loader/files/322276/bb8.obj.zip)\r\nbut it doesn't show up. I downloaded the model from http://tf3dm.com, and it seems to work in http://www.meshlabjs.net/\r\n\r\nI cloned webgl-obj-loader and checked out in the gh-pages branch. Then I added my model in the models/ directory and makes the window.onload function in webgl.js load \"bb8.obj\" instead of \"suzanne,obj\" and the result is... that nothing appear on the pedestal\r\n![screen](https://cloud.githubusercontent.com/assets/6087390/16177138/04355646-3625-11e6-871b-9bd9b8e3e7a5.png)\r\n\r\nI looked at the javascript console, and this is what I got:\r\n```\r\n\tnon well-formed tunnel_ceiling.obj:1:2\r\n\tnon well-formed tunnel_walls.obj:1:2\r\n\tnon well-formed room_walls.obj:1:2\r\n\tnon well-formed room_ceiling.obj:1:2\r\n\tnon well-formed room_floor.obj:1:2\r\n\tnon well-formed room_tunnel_ceiling.obj:1:2\r\n\tnon well-formed room_tunnel_walls.obj:1:2\r\n\tnon well-formed room_wall_broken.obj:1:2\r\n\tnon well-formed room_wall_unbroken.obj:1:2\r\n\tnon well-formed bb8.obj:1:2\r\n\tnon well-formed pedestal.obj:1:2\r\n\tnon well-formed boulder.obj:1:2\r\n```\r\nA \"non well formed\" for each .obj files I tried to load (also for those that I didn't changed such as \"boulder.obj\"). I get the same errors on http://frenchtoast747.github.io/webgl-obj-loader/, but of course I can see suzanne on the pedestal.\r\n\r\nI watched into the .obj files, and I saw that there were some missing lines in bb8.obj, that I added:\r\n```\r\n\to bb8.obj\r\n\tg default\r\n```\r\nbut nothing changed.\r\n\r\nI also noticed that the lines are in different order from the other files: in \"suzanne.obj\", there are a lot of lines that starts with \"v\", then a lot of lines that starts with \"vn\", then a lot of lines that starts with \"f\"\r\nin \"bb8.obj\", there are a lot of lines that starts with \"v\", then a lot of lines that starts with \"vn\", then a lot of lines that starts with \"vt\", then a line that begins with \"s\" and finally lot of lines that begins with \"f\" and \"s\", mixed.\r\nAs I said before, I know nothing about the obj format, I can just guess that each line defines a vertex, and in the two files the lines order is different.\r\nI wonder why webgl-obj-loader cannot load my .obj file, or as an alternative, can you please tell me how to reorder the lines in my file to get it loaded?\r\n\r\nThank you in advance,\r\nLucio\r\n"},"comment":{"url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/comments/227243674","html_url":"https://github.com/frenchtoast747/webgl-obj-loader/issues/27#issuecomment-227243674","issue_url":"https://api.github.com/repos/frenchtoast747/webgl-obj-loader/issues/27","id":227243674,"user":{"login":"frenchtoast747","id":1094000,"avatar_url":"https://avatars.githubusercontent.com/u/1094000?v=3","gravatar_id":"","url":"https://api.github.com/users/frenchtoast747","html_url":"https://github.com/frenchtoast747","followers_url":"https://api.github.com/users/frenchtoast747/followers","following_url":"https://api.github.com/users/frenchtoast747/following{/other_user}","gists_url":"https://api.github.com/users/frenchtoast747/gists{/gist_id}","starred_url":"https://api.github.com/users/frenchtoast747/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frenchtoast747/subscriptions","organizations_url":"https://api.github.com/users/frenchtoast747/orgs","repos_url":"https://api.github.com/users/frenchtoast747/repos","events_url":"https://api.github.com/users/frenchtoast747/events{/privacy}","received_events_url":"https://api.github.com/users/frenchtoast747/received_events","type":"User","site_admin":false},"created_at":"2016-06-20T19:27:18Z","updated_at":"2016-06-20T19:27:18Z","body":"Hmm, I know for sure that I saw faces (f) with more than 3 vertices (usually there were 4). The loader currently only supports a maximum of 4, so maybe there are some faces with more than 4? \r\n\r\nThere is an issue (#25) to support N-gons, but it hasn't been worked yet.\r\n\r\nTry exporting the model in Blender again, but this time select the check box for triangulating the faces. This will force the output to have exactly 3 vertices per face.\r\n![](https://i.stack.imgur.com/WFgPs.png)\r\n\r\nI will also have to check out the \"non well-formed\" errors.\r\n\r\nThanks for reporting this and for all of the detailed information!"}}
{"actor":{"display_login":"frenchtoast747"}}