Are you seeing the same problem at
http://chemapps.stolaf.edu/jmol/docs/examples-12/test/jBox.html ?
(enter
=1crn
in the input box, for instance)
That's working fine for me.
Bob
On Sun, Oct 7, 2012 at 6:56 AM, eric henon <eric.he...@univ-reims.fr> wrote:
> Robert,
>
> many thanks for your answer.
> It is a very nice "tweak" to buffer jMolScript instructions like that.
> I did it.
>
> Unfortunately, the "lag" problem remains when using jmolInitialize(".",
> true); (signed Applet mode)
> whatever using the Safari or FireFox web browser.
>
> Did you observe the same problem ?
>
> Thanks again.
> Eric
>
>
> Le 6 oct. 2012 à 22:12, Robert Hanson a écrit :
>
> Eric, there are a number of problems with that page. I don't know about
> the signed/unsigned business, but first let's get this part fixed:
>
> // calculate the three dimensions of the box
> jmolScript("Vx = (V1.x - V5.x)");
> jmolScript("Vy = (V1.y - V5.y)");
> jmolScript("Vz = (V1.z - V5.z)");
> jmolScript("a = sqrt(Vx*Vx + Vy*Vy + Vz*Vz)");
>
> jmolScript("Vx = (V1.x - V3.x)");
> jmolScript("Vy = (V1.y - V3.y)");
> jmolScript("Vz = (V1.z - V3.z)");
> jmolScript("b = sqrt(Vx*Vx + Vy*Vy + Vz*Vz)");
>
> jmolScript("Vx = (V1.x - V2.x)");
> jmolScript("Vy = (V1.y - V2.y)");
> jmolScript("Vz = (V1.z - V2.z)");
> jmolScript("c = sqrt(Vx*Vx + Vy*Vy + Vz*Vz)");
>
>
> // calculate the box volume
> jmolScript("volume = a * b * c ");
> vol=jmolEvaluate("volume%1");
> aa =jmolEvaluate("a%1");
> bb =jmolEvaluate("b%1");
> cc =jmolEvaluate("c%1");
>
>
> This will not work properly and is very inefficient. First, get all those
> script calls into one string:
>
> "Vx = (V1.x - V5.x);Vy = (V1.y - V5.y);Vz = (V1.z - V5.z);a = sqrt(Vx*Vx +
> Vy*Vy + Vz*Vz);Vx = (V1.x - V3.x)..."
>
> With that in mind, you should probably just use:
>
> "V1.distance(V5)"
>
> But the more important thing is that jmolScript is asynchronous, and
> jmolEvaluate is not. Really what you want is this:
>
> a = jmolEvaluate(V1.distance(V5))
> b = jmolEvaluate(V1.distance(V3))
> c = jmolEvaluate(V1.distance(V2))
> vol = a * b * c
>
> you can do the rounding in JavaScript.
>
>
> But.... on the other hand, it will work fine with just this little tweak:
>
> At the top of your script tag, add this to buffer the script into Jmol:
>
> jmolScript0 = jmolScript;
>
> script = ""
> jmolScript = function(a) {
> // buffer these into jmol -- jmolScript() by itself clears the buffer
> if (a) {
> script += ";" + a;
> } else {
> jmolScript0(script);
> script = "";
> }
> }
>
> then add
>
> jmolScript()
>
> just before
>
> vol=jmolEvaluate("volume%1");
>
> and just at the end of the drawBox() function.
>
> You should be all set.
>
> Really a very cool page!
>
> Bob
>
>
>
>
>
> On Fri, Oct 5, 2012 at 11:20 PM, eric henon <eric.he...@univ-reims.fr>wrote:
>
>> Dear all,
>>
>> once more I meet one
>> problem using my jMol code (attached).
>>
>> When using the signed applet,
>> the applet becomes very very slow.
>>
>> For example,
>> rotating my box into the jMol windows
>> (I built a box that I can translate, rotate, scale)
>> takes about 3-4s for each rotation, while
>> it is quasi-instantaneous using the unsigned applet.
>>
>> Thus, only adding the true parameter in the jmolInitialize
>> method substantially influences the performance
>> of the applet.
>>
>> Is it a "standard" behavior ?
>>
>> Thanks in advance.
>> Best regards.
>> Eric Henon
>>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Jmol-developers mailing list
>> Jmol-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>>
>>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Chemistry Department
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> If nature does not answer first what we want,
> it is better to take what answer we get.
>
> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>
> http://p.sf.net/sfu/newrelic-dev2dev_______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
>
> Eric Henon
> Professeur
> Universite de Reims Champagne-Ardenne
> Institut de Chimie Moleculaire de Reims
> http://www.univ-reims.fr/ICMR
> CNRS UMR 6229
> UFR des Sciences Exactes et Naturelles
> BP 1039
> 51687 Reims Cedex 2 (France)
> Tél./Fax : + 33 (0) 3 26 91 84 97
> eric.he...@univ-reims.fr
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers