Open gessha opened 8 years ago
Colors in GLmol are assigned to each vertex (in THREE.Geometry object), not THREE.Material. This is why
child.material.color = newColor;
does not work.
So, do you have to do anything other than this?
GLmol.prototype.changePdbColor = function(id, color){
console.log("[GLmol][changePdbColor] beginning of function");
var currentPDB = _.where(this.modelGroup.children, {name: id})[0];
var colorNew = new TCo(0x00FF00); // constant color for debugging purposes
currentPDB.children.forEach(function(child){
child.children.forEach(function(inner_child){
inner_child.geometry.colorAll(newColor);
});
});
this.show();
}
Hi, I've been working on extending the functionality of this library and I've been designing a modern minimalist UI for it and what I'm working right now is adding the functionality of changing the color of an existing surface in the model group. I tried doing this:
But all this does is just mess up the color and it doesn't really change it. How are you supposed to change the color?