On Mar 23, 2006, at 1:36 PM, Bob Hanson wrote:

[Frieda wrote:]
Using set windowCentered OFF, this works. There is a small jump due  to perspective depth. However, this may become a large jump in a  macromolecule...

This is something I don't understand and can certainly be turned of or optional if desired. It's a scaling that is done when centering is done. No particular need for it, but there must be a reason it's there.

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.

have Jmol compute the coordinates of a moveTo command that would move  the center of a specified atomset to the (XY) center of the applet.

Trivial -- just "transformPoint()"

I am sending a separate email on this since it is long-winded.

You could then center the atomset without fear that there would be  any jump. This would mean that you could easily make a smooth  transition from a whole-protein view to a close-up of an active site  (say) where the active site would now be the center of rotation. 

Since the moveTo can take you anywhere, that's done. Doesn't moveTo do that already?

The point is that it *would*... if I knew the coordinates to enter into moveTo that would place the atomset's center at the XY center. So if learning those coordinates is trivial using transformPoint(), I would *really* like to know more about what transformPoint() is, and have asked specifically about it in the other email I am sending. 


Currently I have to do a real dance script-wise to get this to happen  smoothly, and it is far from perfect.

show me an example, and I'll play with it. (next week)

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).


Is it feasible for Jmol to compute that moveTo?
(This request may have a familiar ring to it, especially for Miguel...)

Define that more precisely.

I hope I have made it clearer above, let me know if not.

But, yes, Jmol can compute anything like this....

Miguel suggested that discussion of this move onto the developer's list, which I am not on. Should I subscribe, or can you cc me when relevant? 

In my tests, the still molecule jumps-- not a rescale sort of jump--  much larger, and yet $line1 does not go to the center of the window.  In fact, whether windowCentered is on or off has no effect on this jump.

It's a bug. The second one is not supposed to jump.

OK. Thanks, Bob.

Frieda



///////////////////////////////////////////


Frieda Reichsman, PhD

Molecules in Motion

Interactive Molecular Structures

http://www.moleculesinmotion.com


///////////////////////////////////////////



Reply via email to