{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/10056","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/10056/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/10056/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/10056/events","html_url":"https://github.com/mrdoob/three.js/issues/10056","id":187871499,"number":10056,"title":"glTF and Blender export : corrupted normals + vertices data","user":{"login":"feiss","id":359872,"avatar_url":"https://avatars.githubusercontent.com/u/359872?v=3","gravatar_id":"","url":"https://api.github.com/users/feiss","html_url":"https://github.com/feiss","followers_url":"https://api.github.com/users/feiss/followers","following_url":"https://api.github.com/users/feiss/following{/other_user}","gists_url":"https://api.github.com/users/feiss/gists{/gist_id}","starred_url":"https://api.github.com/users/feiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feiss/subscriptions","organizations_url":"https://api.github.com/users/feiss/orgs","repos_url":"https://api.github.com/users/feiss/repos","events_url":"https://api.github.com/users/feiss/events{/privacy}","received_events_url":"https://api.github.com/users/feiss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-08T00:45:21Z","updated_at":"2016-11-08T23:11:17Z","closed_at":null,"body":"I'm trying to load **a single triangle** exported to glTF directly from Blender, using [Daniel Stokes' exporter](https://github.com/Kupoman/blendergltf). \r\n\r\n`.blend` file can be downloaded [here](http://www.filedropper.com/triangle)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/359872/20081444/007d5040-a550-11e6-8af9-5adf788a7028.png)\r\n\r\nVertices at `(1, 0, 0)`, `(0, 1, 0)` and `(0, 0, 1)`. The equivalent JSON is this (removed the metadata):\r\n\r\n```\r\n{\r\n    \"faces\":[32,0,2,1,0,0,0],\r\n    \"name\":\"PlaneGeometry.2\",\r\n    \"vertices\":[0,-0,-1,0,1,-0,1,0,0],\r\n    \"normals\":[-0.57735,0.57735,0.57735]\r\n}\r\n```\r\n\r\n[**This is the `triangle.gltf` file exported from Blender**](https://gist.github.com/feiss/1e503b585e61384a451c82aa4fd1f25e). \r\n\r\nI slightly modified the exporter for printing out the vertices and normals, and they were correct. (I put a `print(co[j])` and `print(normal[j])` in `blendergltf.py:518`)\r\n\r\nI have to export with **selection only** checked. If it is unchecked, nothing appears on the scene.\r\n\r\nResult: the mesh is corrupted. Normals are wrong and one vertex is bad -- Something get mixed in the bufferViews/accessors/whatever that it mixes some values from normals and vertex positions. If you try to import the `triangle.gltf` in the threejs editor, it looks like this:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/359872/20081711/9095a3fc-a551-11e6-8453-e1243826208c.png)\r\n\r\n(the red dot is where that stranded vertex is supposed to be)\r\n\r\nI also used `aframe-gltf.js` loader from @richtr and same happens. If I use developer tools to debug the loaded mesh, it shows:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/359872/20081862/750b960e-a552-11e6-87d8-d582ff9f59f2.png)\r\n\r\n\r\nI guess @Kupoman , @richtr or @xirvr may want to take a look. I hope this is not a trivial problem caused for something I did wrong, the scenario is so simple I cannot grasp what I could have done wrong.. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/259289029","html_url":"https://github.com/mrdoob/three.js/issues/10056#issuecomment-259289029","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/10056","id":259289029,"user":{"login":"pjcozzi","id":782098,"avatar_url":"https://avatars.githubusercontent.com/u/782098?v=3","gravatar_id":"","url":"https://api.github.com/users/pjcozzi","html_url":"https://github.com/pjcozzi","followers_url":"https://api.github.com/users/pjcozzi/followers","following_url":"https://api.github.com/users/pjcozzi/following{/other_user}","gists_url":"https://api.github.com/users/pjcozzi/gists{/gist_id}","starred_url":"https://api.github.com/users/pjcozzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjcozzi/subscriptions","organizations_url":"https://api.github.com/users/pjcozzi/orgs","repos_url":"https://api.github.com/users/pjcozzi/repos","events_url":"https://api.github.com/users/pjcozzi/events{/privacy}","received_events_url":"https://api.github.com/users/pjcozzi/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T23:11:17Z","updated_at":"2016-11-08T23:11:17Z","body":"I agree it could be the exporter, the model doesn't load here: http://cesiumjs.org/convertmodel.html\r\n\r\nYou could also try the validator (but it is for the glTF 1.1 spec work-in-progress): https://github.com/KhronosGroup/glTF-Validator\r\n\r\n@feiss if you confirm this is an exporter issue, can you please submit an issue or PR to that repo?  A solid Blender glTF exporter will be super valuable to the community."}}
{"actor":{"display_login":"pjcozzi"}}