From: John Stone (johns_at_ks.uiuc.edu)
Date: Thu Apr 01 2004 - 13:26:17 CST

Vlad,
  Here's a simple script that does something akin to what you have
in mind, except that it draws user defined text rather than a triangle.
Enjoy,
  John Stone
  vmd_at_ks.uiuc.edu

##
## Example script showing a way to add user-drawn geometry that updates
## as a trajectory is animated.
##
## To use this script:
## 1) load your trajectory
## 2) source frameupdate.vmd
## 3) enabletrace
## 4) do your thing :-)
## 5) disabletrace

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 white
  set psperframe 1.03
  set time [format "%8.3f ps" [expr $vmd_frame([molinfo top]) * $psperframe]]
  draw text {10 10 0} "$time"
}

On Thu, Apr 01, 2004 at 06:20:56PM +0200, Vlad Cojocaru wrote:
> Dear VMD users,
> I have another question regarding the draw command. I managed to draw
> the triangle but now I have 1000 frames of the trajectory and for each
> frame a different triangle. The VMD displays for each frame all the
> triangles. I am wondering if there is a way to animate the triangles in
> such a way that on each frame only the corresponding triangle to be
> displayed.
> Thanks for answering
> vlad
>
> --
> Vlad Cojocaru
> Max Planck Institute for Biophysical Chemistry
> Department: 060
> Am Fassberg 11, 37077 Goettingen, Germany
> tel: ++49-551-201.1327
> e-mail: Vlad.Cojocaru_at_mpi-bpc.mpg.de
> home tel: ++49-551-9963204
>
>

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078