The idea is that you might want to send quite a few of these. So there 
is no refresh. That is, you won't see the effect until you issue a 
"refresh" command. The sequence I used as a test (Jmol 11.3.6) is:

function test1() {
 
jmolSetAtomCoordRelative(Math.floor(Math.random()*6),Math.random()/5-0.1,Math.random()/5-0.1,Math.random()/5-0.1)
 jmolScriptWait("refresh")
}

this worked fine. If you want to send a set of coordinates, then you can 
use the data command:

data "coord"
3;
0 , , 2.3 3.1 4.0;
5 , , 3.3 4.4 5.1;
10 , , 6.2 7.3 8.1;
end "coord"

* The first number is the number of points to follow.
* Records are separated by semicolons and, if desired, a new line
* Items are separated by any whitespace.
* The first number is the atom index, starting with 0 and running 
through ALL loaded models; then two dummy fields, then the x y z 
coordinates follow that.
* The commas above are just placeholders; they can be any character or 
word, as long as they are separated from the other data by spaces. At 
the moment I can't remember what they are for!

Ah, I have a feeling I forgot to document this. :)

Bob
            
Jason Persampieri wrote:

> Howdy,
>
> New Jmol user here, and of course I want to jump straight in to the 
> 'experimental' stuff :)  I am using version 11.2.4, the applet module, 
> and have done testing in several browsers (incl Opera and Firefox).
>
> In short, nothing (visually) happens when calling jmolSetAtomCoord 
> (nor jmolSetAtomCoordRelative).  I've verified everything is ok going 
> in to the viewerObject.setAtomCoord call.  Looking at the codepath in 
> the Java source, it seems like this eventually does the same thing as 
> the 'translateSelected' script call (after selecting one atom, of 
> course) except it sets the coordinates directly as opposed to an offset.
>
> In fact, replacing the actual setAtomCoord call in 
> Jmol.js=>jmolSetAtomCoord with
>
> applet.script ('select atomno=' + i + ';translateSelected {'+x+' '+y+' 
> '+z}')
>
> works as you would expect.
>
> As for the 'Why?', well, we have a fairly large model we want to 
> animate based on a process running on the server.  I'm using an Ajax 
> call to get a list of new atom positions, and need to update just 
> those atoms.  If I can't get this to work, I guess I'll just keep 
> track of current positions and calculate offsets, but being able to 
> set them directly would be much nicer... especially for setting the 
> whole model back to a single point (which I need to do at the start 
> and on user-command).
>
> Can anyone shed any light on this?  Or have an alternate suggestion?
>
> _jason
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Splunk Inc.
>Still grepping through log files to find problems?  Stop.
>Now Search log events and configuration files using AJAX and a browser.
>Download your FREE copy of Splunk now >>  http://get.splunk.com/
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-- 
Robert M. Hanson
Professor of Chemistry
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



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to