From: John Stone (johns_at_ks.uiuc.edu)
Date: Tue Jan 13 2009 - 16:35:01 CST

Hi,
  What version of VMD are you using? It works for me with VMD 1.8.7
alpha versions, however it draws so rapidly that you can hardly see it go. :-)
It could be that your machine is faster yet, and so you literally just see it
"pop" to the final frame. It should be relatively easy to add a
"wait" or "sleep" or some other delay, or otherwise make the demo
more graphically demanding to get it to display less rapidly.

Cheers,
  John Stone
  johns_at_ks.uiuc.edu

On Fri, Dec 19, 2008 at 09:52:05AM -0300, Alberto Sergio Garay wrote:
> Hi all
>
> I'm trying to make my own animation script starting (learning) from
> the vmd animation example. But when I run it in my PC it doesn't work.
> It just only
> did one iteration step and then exit. Am I doing something wrong?. I
> just only copied the script from the webpage of vmd, saved it in a
> file and run it.
> Could anyone give any clue of how to solve it?
>
> Below I've pasted the script I took from the vmd web page:
>
> proc swing {} {
> # get rid of everything else (if there is anything)
> if [expr [molinfo top] != -1] { mol off all }
> # create a new graphics molecule to handle just this
> mol load graphics "swing"
> set mol [molinfo top]
> set center {0 0.5 0}
> set radius 0.125
> set offset ".25 0 0"
> set length 1
> set firsttime 1
> display resetview
> axes location off
> stage location off
> for {set i 0} {$i < 1000} {incr i} {
> display update off
> scale by 1.003
> rotate y by 5
> display update on
> set top1 [vecsub $center $offset]
> set top2 $center
> set top3 [vecadd $center $offset]
> # compute the bottom location
> set bot1 [vecsub $top1 "0 $length 0"]
> set bot2 [vecsub $top2 "0 $length 0"]
> set bot3 [vecsub $top3 "0 $length 0"]
> set xdiff [expr sin($i/10.0)]
> set ydiff [expr 1.0 - abs(cos($i/10.0))]
>
> if [expr $xdiff < 0] {
> set bot1 [vecadd $bot1 "$xdiff $ydiff 0"]
> } else {
> set bot3 [vecadd $bot3 "$xdiff $ydiff 0"]
> }
> if $firsttime {
> set firsttime 0
> display resetview
> } else {
> graphics $mol delete all
> }
> # draw the three different balls/strings in different colors
> graphics $mol color red
> graphics $mol sphere $bot1 radius $radius
> graphics $mol color green
> graphics $mol sphere $bot2 radius $radius
> graphics $mol color blue
> graphics $mol sphere $bot3 radius $radius
> graphics $mol materials off
> graphics $mol color red
> graphics $mol line $top1 $bot1
> graphics $mol color green
> graphics $mol line $top2 $bot2
> graphics $mol color blue
> graphics $mol line $top3 $bot3
> display reshape
> }
> display update on
> }
>
> Thank you in advance
>
> Sergio
> --
> Dr. Sergio Garay
> Facultad de Bioquimica y Cs. Biológicas
> Universidad Nacional del Litoral
> Santa Fe - Argentina
> C.C. 242 - Ciudad Universitaria - C.P. S3000ZAA
> Argentina
> Ph. +54 (342) 4575-213
> Fax. +54 (342) 4575-221
>
>
>
>
>

-- 
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