I've got some .js files that were exported from Blender, and I'm loading them using THREE.JSONLoader();
In my callback function:
var callback = function( geometry ) { createMesh(geometry);
For loading the file:
loader.load( "Models/sculp.js", callback );
This is my method for creating meshes:
function createMesh(geometry){
inArr[id] = new THREE.Mesh( geometry, new THREE.MeshLambertMaterial( { color: 0xbbbbbb} ) );
inArr[id].scale.set( 100, 100, 100 );
scene.add( inArr[id] );
id++;
}
Now, I want to be able to change the material of objects at runtime by using my keyboard (to alter color and opacity).
How can I achieve this interactive functionality?