synchronizing molecule rotation

User 2a3dba2aa7

03-11-2005 15:26:33

I have a marvinview table built in my web page using the javascript 1.1 interface, with two molecules in each cell. I'd like to be able to tell the viewer applet that if the user rotates in 3D one of the pair, the other molecule in the same cell should rotate synchronously with it.





Can that be done?

ChemAxon 7c2d26e5cf

04-11-2005 15:38:35

Yes, you can do it. Use the animate() method of the applet (JMView or MView):


http://www.chemaxon.com/marvin/doc/api/JMView.html#animate(java.lang.String)


http://www.chemaxon.com/marvin/doc/api/MView.html#animate(java.lang.String)


See the following example:
Quote:
<script LANGUAGE="JavaScript1.1" SRC="../../marvin.js"></script>


<script LANGUAGE="JavaScript1.1">


<!--


mview_name="viewer";


mview_begin("../..", 201, 241);


mview_param("background", "#ffffff");


mview_param("molbg", "#000000");


mview_param("navmode", "rot3d");


mview_param("rendering", "ballstick");


mview_param("rows", "2");


mview_param("cols", "2");


mview_param("border", "1");


mview_param("layout", ":2:1:M:1:0:1:1:L:0:0:1:1:c:n:1:1");


mview_param("param", ":M:100:100:L:10b");


mview_param("cell0", "|../../mols-3d/nci1949.csmol|1949");


mview_param("cell1", "|../../mols-3d/nci1683.csmol|1683");


mview_param("cell2", "|../../mols-3d/nci1659.csmol|1659");


mview_param("cell3", "|../../mols-3d/nci15976.csmol|15976");


mview_end();





function rotate() {


if(document.viewer != null) {


viewer.animate("0,1");


}


}


//-->


</script>


<form>


<input type=button value="Rotate" onclick="rotate()">


</form>

ChemAxon 7c2d26e5cf

04-11-2005 15:54:34

Sorry, I have missunderstood your question.


You can not tell the MarvinView applet that if the user rotates in 3D one of the pair, the other molecule in the same cell should rotate synchronously with it.


But it is possible in MarvinSpace.


MarvinSpace is also available as applet. It is bundled with Marvin release. In the current release (Marvin 4.0.1), there is no API for MarvinSpace to do this. But in the next version (Marvin 4.0.2) the API will be available. The new Marvin will be released very very soon. We will send you an example about it if new MarvinSpace will be available.

ChemAxon 909aee4527

10-11-2005 14:39:56

Marvin 4.0.2 is released, MarvinSpace 1.0 beta version with API is available.


There is a Java Web Start example about synchron rotation in MarvinSpace here. (See the second example there.)


A simpler applet example is also available here.