I am trying to apply a material/color to a loaded object using Three.js, but I am struggling with the syntax and which variables/functions to use. Although I can successfully load the object, I am facing difficulties when trying to set a material for it.
//Object loader
var loader = new THREE.OBJLoader();
loader.load( '3D4.obj', function ( object ) {
// Unsure about what steps are needed here to add a material to the object
var mesh = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial( {color: 0xFF0000} ));
// Add the object to the scene
scene.add( object );
});