计算化学公社

标题: 求助:vmd tcl script中怎么确定绕x/y/z的旋转角度以得到合适的视角? [打印本页]

作者
Author:
qmlearner    时间: 2020-11-14 18:17
标题: 求助:vmd tcl script中怎么确定绕x/y/z的旋转角度以得到合适的视角?
用Multiwfn得到一系列ELF的.cub文件,想通过vmd制作一个ELF变化的动画(参考社长的帖子http://sobereva.com/200)。
那么怎么通过.tcl脚本将分子调整到想要的视角呢?

比如下面是我在社长isoall.tcl脚本的基础上稍作改动后的脚本(只是测试用,没有批量处理功能),把rotate x/y/z 后面的值,还有x,y,z的顺序改了很多次,
但总是没能得到想要的那个视角。


于是我用vmd打开一个.cub文件,将分子调整到一个比较合适的角度,想看看哪里有没有显示我绕x,y,z旋转过的角度,但是我没有找到。
请问一下大家都是怎么解决的呢?

**************************************************

color Display Background white
display projection orthographic
display depthcue off
set isoval 0.8
axes location Off
set name ELF
puts "Processing $name.cub..."
mol default style CPK
mol new $name.cub
scale to 0.3
rotate y by 80
rotate x by 150
rotate z by -20
mol addrep top
mol modstyle 1 top Isosurface $isoval 0 0 0 1 1
mol modcolor 1 top ColorID 3
*****************************************************



作者
Author:
snljty    时间: 2020-11-14 22:00
拿鼠标转。转完了以后,
  1. set current_view [molinfo top get {center_matrix rotate_matrix scale_matrix}]
  2. puts $current_view
复制代码
导出当前视图,
  1. molinfo top set {center_matrix rotate_matrix scale_matrix} $current_view
复制代码

设置新视图为之前导出的视图。
作者
Author:
sobereva    时间: 2020-11-14 23:14
(, 下载次数 Times of downloads: 54)
(, 下载次数 Times of downloads: 54)

作者
Author:
qmlearner    时间: 2020-11-15 08:44
snljty 发表于 2020-11-14 22:00
拿鼠标转。转完了以后,
导出当前视图,

谢谢老师!
作者
Author:
qmlearner    时间: 2020-11-15 08:45
sobereva 发表于 2020-11-14 23:14

谢谢sob老师!
作者
Author:
qmlearner    时间: 2020-11-15 12:38
sobereva 发表于 2020-11-14 23:14

卢老师,我按您和snljty老师的指导,写了下面的iso.tcl。
我的具体操作步骤是:
1)在当前目录启动vmd (我是ubuntu18.04, vmd1.9.3)
2)打开一个.cub文件,转好想要的角度
3)source iso.tcl

但是在当前目录下没有生成view.txt文件 ,所以最后得到的.bmp也不是想要的视角。恳请您再次指点一下,十分感谢:)

***************************************
proc sv {} {
set myfile [open view.txt w]
set view [molinfo top get {center_matrix rotate_matrix scale_matrix global_matrix}]
puts $myfile $view
puts $myfile [display get size]
close $myfile
}
mol delete top
color Display Background white
display projection orthographic
display depthcue off
set isoval 0.8
axes location Off
for {set i 1} {$i<=26} {incr i} {
set name ELF[format %03d $i]
puts "Processing $name.cub..."
mol default style CPK
mol new $name.cub
scale to 0.3
proc lv {} {
set myfile [open view.txt r]
gets $myfile view
gets $myfile winsize
close $myfile
eval "display resize $winsize"
molinfo top set {center_matrix rotate_matrix scale_matrix global_matrix} $view
}
mol addrep top
mol modstyle 1 top Isosurface $isoval 0 0 0 1 1
mol modcolor 1 top ColorID 3
render snapshot $name.bmp
mol delete top
}
***************************************
作者
Author:
sobereva    时间: 2020-11-16 03:38
qmlearner 发表于 2020-11-15 12:38
卢老师,我按您和snljty老师的指导,写了下面的iso.tcl。
我的具体操作步骤是:
1)在当前目录启动vmd  ...

你得在VMD窗口里运行sv命令
这个脚本只是定义了这个命令,你不运行起不到效果
作者
Author:
qmlearner    时间: 2020-11-16 10:24
sobereva 发表于 2020-11-16 03:38
你得在VMD窗口里运行sv命令
这个脚本只是定义了这个命令,你不运行起不到效果

成了,谢谢卢老师:))




欢迎光临 计算化学公社 (http://bbs.keinsci.com/) Powered by Discuz! X3.3