When click on a face, remember its index. On next click, compare indices. If they are equal, then no changes. If they are not equal, change the colour of the face with selected index, return the color to the face with previous index, remember the index of selected face.
if ( intersects.length > 0 )
{
//console.log("Hit @ " + toString( intersects[0].point ) );
//test items in selected faces array
// var test=-1;
// selectedFaces.forEach( function(arrayItem)
// {
// // if the faceIndex and object ID are the same between the intersect and selected faces ,
// // the face index is recorded
// if(intersects[0].faceIndex==arrayItem.faceIndex && intersects[0].object.id==arrayItem.object.id){
// test=selectedFaces.indexOf(arrayItem);
// }
// });
//console.log(selectedFaces.length);
var val = selectedFaces.length;
//console.log(test);
var a = intersects[0].faceIndex;
console.log("a is " + a);
var b;
//console.log("b is " + b);
if( intersects[0].faceIndex == a){
console.log("same");
}
else{
console.log("not same");
}
}