From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Thu Jan 28 2016 - 17:16:48 CST

On Jan 28, 2016 22:46, "Nima Emadi" <deeepsky_at_gmail.com> wrote:
>
> Thanks Josh
>
> Using bond representation is a good idea that can work for simple
cylindrical particles. However, In my case, the actual particle is much
more complicated than jus a single cylinder. I have a tripod like rigid
particle which I can draw easily using a collection graphics commands with
a help of a script which reads the trajectory and generates a tcl output
for each snapshots of the trajectory. I just need to combine all these
snapshots in VMD to make a movie.
>
> Note that I want to be able to play and/or change the viewing angle of
the movie in the vmd GUI, just like a normal trajectory which is loaded in
vmd. Is this possible without so much effort? Would be great, If you could
point me to a similar script that can do this.

Graphics elements are global and not per-frame. If you want dynamic
graphics elements, you need to store the data for it somewhere, and then
have a function redraw or update it via tracing the vmd_frame variable.
Check out the pdf at the link below for some examples of dynamic graphics
etc.

https://sites.google.com/site/akohlmey/redirect/cpmd-vmd.pdf?attredirects=0&d=1

Axel

>
> Cheers,
> Nima
>
> On Thu, Jan 28, 2016 at 8:52 PM, Josh Vermaas <vermaas2_at_illinois.edu>
wrote:
>>
>> Hi Nima,
>>
>> Its a bit unclear as to what you will be doing, which might impact how
easy it is to get setup. If your real cylinders are atoms connected by
bonds that merely look cylindrical, the "bonds" representation is probably
what you want, and gets around using the graphics commands at all. The
reason the graphics commands sound like they might be alot of work is that
they don't vary if you add more frames. So in order to make a movie using
graphics objects alone, you'd need to draw a frame, render the frame, clear
the frame, draw the next frame, render the frame, clear it, and so on and
on until you've drawn everything. Luckily this can all be scripted, but
animate dup 0 won't do anything for you unfortunately.
>>
>> -Josh Vermaas
>>
>>
>> On 01/28/2016 02:10 PM, Nima Emadi wrote:
>>>
>>> Dear all,
>>>
>>> I want to make a movie from a given MD trajectory of some cylindrical
rigid
>>> particles.
>>>
>>> Using graphics command in tcl, I'm able to produce a single snapshot.
>>> However I am stuck when I want to add a new frame to my molecule.
>>>
>>> Simplified version of what I have in my tcl script (for just one
particle
>>> which moves along z axis) is:
>>>
>>> color Display Background white
>>> mol new
>>> graphics 0 color 7
>>> graphics 0 cylinder {0 0 0} {0 0 1} radius 0.4 resolution 30 filled yes
>>> animate dup 0
>>> graphics 0 delete all
>>> graphics 0 cylinder {0 0 0.5} {0 0 1.5} radius 0.4 resolution 30 filled
yes
>>
>>
>