Tutorials and scripts for scientific visualization
KBS - Home |
---|
Visualization |
Portfolio |
Presentation |
Web Molecular Dynamics (three.js) |
VMD |
SciVisComm |
In VMD you can save the representations you selected so that you can automatically apply them to any trajectory.
pbc set {a b c alpha beta gamma} -all
pbc box_draw -shiftcenterrel {x y z}
pbc set {35 35 40 90 90 90} -all
pbc box_draw -shiftcenterrel {0 0 0}
If you are gonna use this command from the command-line then you would need to load the
pbctools
package first or the pbc
command will not be recognized.
package require pbctools
pbc set {35 35 40 90 90 90} -all
pbc box_draw -shiftcenterrel {0 0 0}
Images can be rendered with render
command in VMD.
render <method> <filename>
render TachyonInternal snapshot.rgb
We can use a for loop and the render
command to render all images in the trajectory file as follows:
for {set i 0} {$i < $num} {incr i} {
# go to the given frame
animate goto $i
# force display update
display update
# take the picture
render TachyonInternal [format snapshot.%04d.rgb $i]
}
Here image files with names such as snapshot.0000.rgb, snapshot.0001.rgb, snapshot.0002.rgb, ...
are generated.
Following line would read all files formatted as shapshot.<number>.rgb
using the rendering script above.
exec convert shapshot.*.rgb movie.gif
exec convert -delay 10 -loop 2 shapshot.*.rgb movie.gif
You can generate a movie using a VMD ‘tcl
script file.
These files can be generated easily using a visualization state.
Once you create a template with the representations you like, save it as a visualization state.
The file you save is basically a list of instructions (tcl
script) that tells VMD how to
represent your molecules.
Adding the necessary instructions to render images in a frame and convert to movie you can generate
a script that would read your trajectory file and output an animated movie without even loading VMD.
Moreover, you can even add that scipt at the end of your MD simulation so it would generate a movie
directly after the simulation is finished.
vmd -dispdev text -eofexit < input.tcl > output.log