VMD-L Mailing List
From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Oct 03 2005 - 16:32:10 CDT
- Next message: mashaojie163: "Re: How can I compile win32-vmd"
- Previous message: Mauricio Carrillo Tripp: "Re: fancy representations for lipids?"
- In reply to: Jeffrey Tseng: "centering the molecule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Jeffrey,
You can simply set the transformation matrices that you
want VMD to use for translation, rotation, and scaling.
Here's an example of how to set them to identity matrices:
set identityvpts {
{{1.000000 0.000000 0.000000 0.000000}
{0.000000 1.000000 0.000000 0.000000}
{0.000000 0.000000 1.000000 0.000000}
{0.000000 0.000000 0.000000 1.000000}}
{{1.000000 0.000000 0.000000 0.000000}
{0.000000 1.000000 0.000000 0.000000}
{0.000000 0.000000 1.000000 0.000000}
{0.000000 0.000000 0.000000 1.000000}}
{{1.000000 0.000000 0.000000 0.000000}
{0.000000 1.000000 0.000000 0.000000}
{0.000000 0.000000 1.000000 0.000000}
{0.000000 0.000000 0.000000 1.000000}}
{{1.000000 0.000000 0.000000 0.000000}
{0.000000 1.000000 0.000000 0.000000}
{0.000000 0.000000 1.000000 0.000000}
{0.000000 0.000000 0.000000 1.000000}}
}
molinfo top set \
{center_matrix rotate_matrix scale_matrix global_matrix} \
$identityvpts
In reality, the only two you would need to set would be the "center_matrix"
and the "scale_matrix". You can set just one of these like this:
set foo {{{0.01 0 0 0} {0 0.01 0 0 } { 0 0 0.01 0 } {0 0 0 1}}}
molinfo top set scale_matrix $foo
The default VMD camera viewing parameters are:
eye position: 0 0 2
eye view direction: 0 0 -1
eye up direction: 0 1 0
The default field of view is about 90 degrees.
You can calculate the correct scaling and translation (centering)
matrices to put the molecule within the visible bounds of the
view frustum with this information.
John Stone
vmd_at_ks.uiuc.edu
On Sun, Oct 02, 2005 at 05:53:00PM -0500, Jeffrey Tseng wrote:
> Hi all,
>
> Dose anyone know how to move the whole molecule to the center of
> the screen by command ?
>
> Using transformation matrices or scripts is highly desirable and appreciated.
>
> Thanks,
>
>
> Jeffrey
-- 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: mashaojie163: "Re: How can I compile win32-vmd"
- Previous message: Mauricio Carrillo Tripp: "Re: fancy representations for lipids?"
- In reply to: Jeffrey Tseng: "centering the molecule"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]