<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi everyone,
<div class=""><br class="">
</div>
<div class="">I am trying to implement a EM density viewer in a HTML page based on the chimera webgl & html export feature.</div>
<div class="">The original page chimera exports when you save a webgl / html scene has been modified to load multiple JSON objects with densities as they come from chimera.</div>
<div class="">The bar at the bottom of the page essentially performs a coarse density sliding similar to chimera. </div>
<div class="">Almost all works great but what I am missing is how to connect the rotation that was applied to one model and to propagate it to all other models.</div>
<div class="">What is happening now is that when one rotates one model and slides the bar, the next model will not be rotated but will be in it’s original position.</div>
<div class=""><br class="">
</div>
<div class="">Here’s my page I am currently working on</div>
<div class=""><a href="http://localize.pytom.org/php/displayWebGL.php?jobID=tutorial" class="">http://localize.pytom.org/php/displayWebGL.php?jobID=tutorial</a></div>
<div class=""><br class="">
</div>
<div class="">I tried catching the mouse event with a loop, but it seems it fails to propagate the rotation to the other models.</div>
<div class="">Check the block at line 916 in the code</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""> try {</div>
<div class=""> var rotMat = vsphere(mouse_position, new_position);</div>
<div class=""> var camera = this.camera;</div>
<div class=""> var matrix = new Mat4;</div>
<div class=""> matrix.$translate(camera.target[0], camera.target[1],</div>
<div class=""> camera.target[2]);</div>
<div class=""> matrix.$mulMat4(rotMat);</div>
<div class=""> matrix.$translate(-camera.target[0], -camera.target[1],</div>
<div class=""> -camera.target[2]);</div>
<div class=""> for (var i = 0, models = this.scene.models, l = models.length; i < l; ++i) {</div>
<div class=""> var elem = models[i];</div>
<div class=""> elem.matrix = matrix.mulMat4(elem.matrix);</div>
<div class=""> }</div>
<div class=""> }</div>
</div>
<div class=""><br class="">
</div>
<div class="">Thank you in advance for your help,</div>
<div class="">Thomas</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</body>
</html>