VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Feb 08 2007 - 12:54:27 CST
- Next message: wolfinbm_at_uci.edu: "Saving work in VMD--this seems ridiculously difficult!"
- Previous message: John Stone: "Re: H-Bond display in VMD"
- In reply to: Levin, Andrew Michael: "viewpoint"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Hi,
There are a few examples of this in the user's guide and
in the VMD script library:
http://www.ks.uiuc.edu/Research/vmd/current/ug/node180.html#14170
http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/rotate_display/
http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/view_change_render/
The overall transformation matrix is the combination:
TM = GlobalTrans * Scale * Rotation * CenterTrans
Or, in the VMD source code (this is done hierarchically for all displayable
objects in the scene):
[...]
tm.identity();
tm.translate(globt);
tm.multmatrix(rotm);
tm.scale(scale);
tm.translate(centt);
// reload this matrix in the display command list
cmdList->mat = tm;
[...]
Beyond this, there are projection transformation matrices that define
the camera model used by VMD, handle stereoscopic display issues like
shearing or eye rotation, or per-display viewing directions as used
in the CAVE or FreeVR. You don't have direct control over the projection
transformation either, but it plays a role as well.
If you want to do something fancy with the viewing orientation, calculate
direction vectors or the like, you may also want to have a look at the
code in the VMD clipping plane tool plugin, which contains routines used
to calculate viewing orientations for some of the features it implements
such as the "viewing orientation tracking" clipping planes...
Cheers,
John Stone
vmd_at_ks.uiuc.edu
On Thu, Feb 08, 2007 at 09:17:48AM -0600, Levin, Andrew Michael wrote:
> Hello!
>
> Which matrix do you use to change to change the view with which you look
> onto your molecule? You cannot directly set view_matrix because it is a
> product of center_matrix, scale_matrix, rotate_matrix, and global_matrix,
> right? Also, if you have more than one molecule, do you only need to
> change the view for the top one?
>
> Thanks.
> AL
>
-- NIH Resource for Macromolecular Modeling and Bioinformatics Beckman Institute for Advanced Science and Technology University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801 Email: johns_at_ks.uiuc.edu Phone: 217-244-3349 WWW: http://www.ks.uiuc.edu/~johns/ Fax: 217-244-6078
- Next message: wolfinbm_at_uci.edu: "Saving work in VMD--this seems ridiculously difficult!"
- Previous message: John Stone: "Re: H-Bond display in VMD"
- In reply to: Levin, Andrew Michael: "viewpoint"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]