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 })));