dynamic modification of rendered molecule (2013-10-10 18:09 by guillaume #70437)
Hi,
please apologize triple post …
First let me say i'am amazed by your work, glmol run smoothly and embedding in page is straight forward.
Once the molecule is loaded is displayed as defined in defineRepresentation,
I am currently trying to alter the rendering of the molecule according to some events triggered by my page.
Using the api in a dumb way, i'am able to modify the internal states of the glmol.atoms list
but the rendering is not altered.
$.get("../data/" + pdbName, function(ret) {
$('#' + self.srcSelector).val(ret);
self.glmol.loadMolecule();
});
//Loading and display ok
//now let's try to modify the color of a growing list of atoms
setInterval (function(){
this.id = this.id ? this.id + 10 : i;
var list = [];
for (var iatom = 1; iatom < this.id; iatom++) {
list.push(iatom);
}
self.glmol.colorAtoms(list, 0x990033);
// console.log(list);
}, 1000);
Do i have to reload the entire molecule with a custom/modified glmol.defineRepresentation ?