From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Mon Aug 22 2016 - 01:04:04 CDT

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