admin管理员组文章数量:1429085
I load a .js model exported from 3DSMAX via convert_obj_three.py and display it using objects 'solid color'.
loader.load( 'try.js', function ( geometry, materials )
{
var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials));
scene.add( mesh );
});
The render mode is basic and descriptive (there is no material in this example). Now I'm trying to add edges ('hidden lines' mode) to get this kind of render (image from 3DSMAX).
The aim would be to add colored edges to the MeshFaceMaterial (lines color would be the same object 'solid color' than faces).
I've notice that we can append materials (like in this stemkoski example) but not been able to do that with my materials json, how would you do that ?
I load a .js model exported from 3DSMAX via convert_obj_three.py and display it using objects 'solid color'.
loader.load( 'try.js', function ( geometry, materials )
{
var mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial(materials));
scene.add( mesh );
});
The render mode is basic and descriptive (there is no material in this example). Now I'm trying to add edges ('hidden lines' mode) to get this kind of render (image from 3DSMAX).
The aim would be to add colored edges to the MeshFaceMaterial (lines color would be the same object 'solid color' than faces).
I've notice that we can append materials (like in this stemkoski example) but not been able to do that with my materials json, how would you do that ?
Share Improve this question edited May 6, 2013 at 11:08 jeum asked May 6, 2013 at 10:55 jeumjeum 1,0943 gold badges14 silver badges30 bronze badges1 Answer
Reset to default 4If your geometry is instanceof THREE.Geometry and not instanceof THREE.BufferGeometry (wireframe is not implemented for BufferGeometry) then you can achieve the effect you want by adding this line to your scene (in addition to the one you have):
scene.add (new THREE.Mesh (geometry,
new THREE.MeshBasicMaterial ({ color: 0x00ffff, wireframe: true })));
本文标签: javascriptThreejsimported modelhow to display edge linesStack Overflow
版权声明:本文标题:javascript - Three.js + imported model : how to display edge lines? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745474486a2659898.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论