最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Three.js + imported model : how to display edge lines? - Stack Overflow

programmeradmin1浏览0评论

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 badges
Add a ment  | 

1 Answer 1

Reset to default 4

If 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 })));
发布评论

评论列表(0)

  1. 暂无评论