Difference between revisions of "Model Space and Camera Space"
(Created page with 'Objects are defined in a Cartesian coordinate system, i.e. as xyz coordinates for each atom (or surface point or corner or...). This coordinate system is model space. To make obj…')
Revision as of 04:56, 7 September 2010
Objects are defined in a Cartesian coordinate system, i.e. as xyz coordinates for each atom (or surface point or corner or...). This coordinate system is model space. To make objects visible, PyMOL places a "camera" such that it sees most of the molecule. The picture that is shown on the screen is the image that is taken by the camera. Initially, after loading an object, the camera is placed such that it looks on the object parallel to the z axis. x and y axes are horizontal respectively vertical. In the beginning, the axes correspond to the physical directions of the screen: x and y are horizontal /vertical, z is perpendicular to the screen. To change the view, normally the camera is moved: view of all the objects is changed simultaneously, the objects are not moved relative to each other. After changing the view, x, y and z axes don't correspond to the directions of the screen anymore.
turn, move, center, zoom, orient and mouse action in viewing mode move the camera in object space.
For easy description of object movement relative to the camera, an additional coordinate system is defined: Camera space. The camera is situated in the origin of camera space, x and y are horizontal respectively vertical and z is the viewing direction. Camera space always corresponds to the directions of the screen.
The relation of camera space and model space is described in the view matrix. (See get_view).
Changing the coordinates in model space is only necessary when objects shall be moved relative to each other or when the transformed coordinates are to be written into a file.
Model space coordinates can be changed with the commands rotate and translate, transform_selection or with the mouse in editing mode.
Space and File saving
When model coordinates are saved (e.g. as a pdb file), PyMOL uses model space coordinates. In contrast, when an image is saved as povray or vrml, camera space coordinates are used. When image files in model space coordinates are needed, first choose colors and representations as needed, then align camera space to model space:
set_view (\ 1, 0, 0,\ 0, 1, 0,\ 0, 0, 1,\ 0, 0, 0,\ 0, 0, 0,\ 0, 300, 1 )
After setting the view, the molecule will probably be out of sight but anyway it will be saved to the file. This can be used e.g. to receive a list of surface points in model space.