[Chimera-users] x,y coordinates of the Chimera screen

Tom Goddard goddard at sonic.net
Tue May 13 12:46:06 PDT 2014


Hi Jan,

  There are not Python functions for molecule positioning relative to the boundary of the graphics window.  While you could write such functions, there are a lot of factors to consider.  Each atom of each molecule has a different distance to the camera — there is no “current distance” unless you wish to take some average distance or center of rotation which may result in your molecule positioning causing some of the molecule to be out of view when placed in the corner.  You’d have to figure out exactly what you want.  Do you want to push the molecule so that its atoms just touch the rectangular cone of the camera view?  Do you want some padding so the molecule is not touching the edge?  Are you going to take into account the radii of atom spheres and the exact geometry of a displayed ribbon so that none of it is clipped when placed in the corner?  Any and all of this can be handled.  If you want to simplify you will sometimes get clipping, sometimes excess padding.  If you are trying to make a high quality movie, I think hand position is the way to produce the most aesthetically pleasing result.  If you are trying to fully automate producing 100 movies, then of course it makes sense to write Python code although the result won’t be as pretty as a hand tailored movie.

	Tom


On May 13, 2014, at 12:25 PM, Jan Kosinski wrote:

> Dear Tom,
> 
> 
>>   Chimera uses perspective projection — in other words, the field of view is a cone.  So the width of the screen might be 100 Angstroms at one distance from the camera and 500 Angstroms at a distance 5 times further from the camera.
> Yes, but anyway given the current distance from the camera, there is a defined range of Angstroms for the screen... So the range changes with the distance, but technically should be possible to get the current range... Maybe there is some function for this in the Python API?
> 
>>  You can use orthographic projection so that the width of the window in Angstroms makes sense.  But it seems to me you are better off positioning the models in a corner or just off screen using the mouse and using savepos to save that position.  Why?  Because if you want to put a molecule in a corner, I guess you want it to be in view, so you need to take into account the exact size of the molecule in its current orientation, likewise if I want it off screen, the size of the molecule in its current orientation will matter.  While you could try to compute that (it is certainly possible using Python Chimera code), it seems like a hard way to setup a movie.
> The size of the molecule seems to be not so difficult to take into account - I have already seen example code for calculating bounding boxes of models in the python code in "tile" function of EnsembleMatch/base.py. Maybe it seems hard way, but actually can save me lots of time if after setting all the positions I decide to aspect ratio or the size of the window or the distance from camera. I am making lots of movies these days, so I am looking for maximal automation ;-)
> 
> Cheers,
> Jan
> 





More information about the Chimera-users mailing list