admin管理员组文章数量:1314488
I am using Three.js's example in the directory:
three.js/examples/webgl_loader_ply.html
And I just swapped their .ply file with mine (made with Blender).
In Blender, I went Vertex Paint > and painted vertices. Before exporting to .ply, I made sure that all checkboxes where checked. And scale is 100.
But the .ply model renders as blue in the three.js's example. (just like the default example). And apparently it is blue because of this code in the example html file:
var geometry = event.content;
var material = new THREE.MeshPhongMaterial( { color: 0x0055ff, specular: 0x111111, shininess: 200 } );
var mesh = new THREE.Mesh( geometry, material );
I was 100% sure that ply files have color values saves as well. But, what am I supposed to do now if that code makes my model blue? Or did I do something wrong in Blender?
I am totally not familiar with Three.js and webGL because I started to learn it just yesterday. Can anyone enlighten me on what is going on and what to do next?
I am using Three.js's example in the directory:
three.js/examples/webgl_loader_ply.html
And I just swapped their .ply file with mine (made with Blender).
In Blender, I went Vertex Paint > and painted vertices. Before exporting to .ply, I made sure that all checkboxes where checked. And scale is 100.
But the .ply model renders as blue in the three.js's example. (just like the default example). And apparently it is blue because of this code in the example html file:
var geometry = event.content;
var material = new THREE.MeshPhongMaterial( { color: 0x0055ff, specular: 0x111111, shininess: 200 } );
var mesh = new THREE.Mesh( geometry, material );
I was 100% sure that ply files have color values saves as well. But, what am I supposed to do now if that code makes my model blue? Or did I do something wrong in Blender?
I am totally not familiar with Three.js and webGL because I started to learn it just yesterday. Can anyone enlighten me on what is going on and what to do next?
Share Improve this question edited Jul 15, 2015 at 14:22 WestLangley 105k11 gold badges287 silver badges283 bronze badges asked Jul 15, 2015 at 8:54 BorissOliSiinBorissOliSiin 3371 gold badge5 silver badges14 bronze badges1 Answer
Reset to default 10i was missing this property vertexColors: THREE.VertexColors
.
All was fine with Blender and the code apart from the property. It works as expected now.
Here is how the line of code should look like:
var material = new THREE.MeshPhongMaterial( { color: 0xffffff, specular: 0x111111, shininess: 200, vertexColors: THREE.VertexColors} );
本文标签: javascriptThreejsply fileswhy colorlessStack Overflow
版权声明:本文标题:javascript - Three.js - ply files - why colorless? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741968226a2407676.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论