论坛: 公开讨论 (Thread #34602)

dynamic modification of rendered molecule (2013-10-10 18:02 by guillaume #70435)

Hi,
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 ()

$.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);


I'am not familiar at all with webgl