On Mar 23, 2006, at 1:36 PM, Bob Hanson wrote: [Frieda wrote:]
I think this is the perspectiveDepth setting. If you set perspectiveDepth off before centering, this in itself causes a small jump, although then there is no jump when the center changes. But then perspectivedepth is off, and when you turn it on again, there will be another jump... Also, testing this on the spin.html page, set perspectiveDepth on/off snaps the currently centered set to the center of the applet and to zoom 100-- even when set windowCentered is OFF (maybe this can be changed). Which brings up the point, also addressed below - that a "center" command automatically sets the zoom to 100, which I think is a big disadvantage.
I am sending a separate email on this since it is long-winded.
I will come up with an example and send under separate cover. But in the meantime here is basically how it works. I script my way around the snap to center by always moving the structure (via moveTo) so that the centered atomset is at what I judge by eye to be center of the applet window (XY). Then I center the atomset, and look at the jump. I adjust the xtrans and y trans coordinates of the moveTo decrease the amount of jumping. I reiterate this process until the jump is minimized. This is far from perfect however because: - there is a lot of trial and error to get the moveTo coordinates that overlap XY and XYZ - the jump is rarely zero, although it can be disguised if the jump is in the same direction as the moveTo - the snap to center also automatically sets zoom to 100... so if you want the moveTo to incorporate zooming in, which is often the case, more reiterated scripting is required to set the new coordinate system's zoom level (vastly different, it turns out). - you must use square applet or hard code applet size or ratio of applet width/length, otherwise the XY point is different for different browser window sizes (not much of a problem, probably want to do that anyway for other reasons).
Frieda /////////////////////////////////////////// Frieda Reichsman, PhD Molecules in Motion Interactive Molecular Structures http://www.moleculesinmotion.com /////////////////////////////////////////// |
- Re: [Jmol-users] spin/rotate consolidation -- request for... Frieda Reichsman
- Re: [Jmol-users] spin/rotate consolidation -- reques... Bob Hanson
- Re: [Jmol-users] spin/rotate consolidation -- re... Frieda Reichsman
- Re: [Jmol-users] spin/rotate consolidation -- reques... Frieda Reichsman

