From: sunyeping (sunyeping_at_aliyun.com)
Date: Mon Aug 22 2016 - 07:17:19 CDT

Dear Prof. Geist,
Please see the two example movies (test1.mpg and test1.mpg):
https://www.dropbox.com/s/0i35bafuub1tpbo/test1.mpg?dl=0https://www.dropbox.com/s/0i35bafuub1tpbo/test1.mpg?dl=0
I am trying to add label text to the residues (HIS3 and TYR7). In the test1, the "Trajectory Smoothing Window Size" for all representations (one cartoon for the sheet structure and two sticks for the two residues" are set to 0, so you can see that the label texts (HIS3 and TYR7) move synchronically with the two stick representations for the two residues and they always attach to the residue stick representations, but all of them move too fast and the movement is not smooth.
However, in the test2,  the "Trajectory Smoothing Window Size" for all representations are set to 40, so the movement of these representations are smooth and slow. Please notice that the label texts lose the synchronism, they appear to flap rapidly and often detach from the residue sticks. I wish the synchronism between label texts and the structure representations can be recovered. So I guess if there is also a "label text smoothing" function in VMD, the problem can be solved. But is there?
Best regards.
Yeping Sun------------------------------------------------------------------From:Norman Geist <norman.geist_at_uni-greifswald.de>Time:2016 Aug 22 (Mon) 14:04To:孙业平 <sunyeping_at_aliyun.com>Cc:vmd-l <vmd-l_at_ks.uiuc.edu>Subject:AW: vmd-l: How to smooth atom labels in a MD trajectory?
Do you mean you would have to smoothly let the labels “fly” from one to the other position? Can you show us an example of the current behavior? Von: owner-vmd-l_at_ks.uiuc.edu [mailto:owner-vmd-l_at_ks.uiuc.edu] Im Auftrag von ???
Gesendet: Samstag, 20. August 2016 20:07
An: vmd-l <vmd-l_at_ks.uiuc.edu>
Betreff: vmd-l: How to smooth atom labels in a MD trajectory? Dear all,  I am making a movie for a MD trajectory in which I want to show the simulation time and simutaneously label several residues. For this purpose I Use the follow script: proc enabletrace {} {  
  global vmd_frame;  
  trace variable vmd_frame([molinfo top]) w drawcounter  
}  
proc disabletrace {} {  
  global vmd_frame;  
  trace vdelete vmd_frame([molinfo top]) w drawcounter  
}  
proc drawcounter { name element op } {  
  global vmd_frame;  
  draw delete all  
  # puts "callback!"  
  draw color red  
  set nsperframe 0.02  
  set nsoffset 20
  set time [format "%4.2f ns" [expr ($vmd_frame([molinfo top]) * $nsperframe) + $nsoffset]]
  draw text {40 40 32} "$time"

  set sel1 [atomselect top "segname P1 and resid 63 and name CA"]
  lassign [$sel1 get {x y z}] coord1
  draw text $coord1 "GLU63"

  draw color blue
  set sel2 [atomselect top "segname P1 and resid 66 and name CA"]
  lassign [$sel2 get {x y z}] coord2
  draw text $coord2 "LYS66"

  draw color green
  set sel3 [atomselect top "segname P3 and resid 2 and name CA"]
  lassign [$sel3 get {x y z}] coord3
  draw text $coord3 "ALA2"
 
  set sel4 [atomselect top "segname P3 and resid 3 and name CA"]
  lassign [$sel4 get {x y z}] coord4
  draw text $coord4 "VAL3"
} This is no problem for the "time" showing. However, the atom labels flap rapidly and can not be visualized clearly. Because I have set the "Trajectory Smoothing Window Size" to 30, I think if I can not do a similar smoothing setting to these atom labels, I can get a satisfying effect. But I don't know how. Could anyone give me some help about this? Thank you in advance!   Yeping Sun