next up previous contents index
Next: 6.4.7 Querying VMD for Up: 6.4 VMD Script Commands Previous: 6.4.5 Setting the transparent

6.4.6 Making the molecule to show up slowly

    The only application of this that I know of is producing a movie for demonstration and having parts of the molecule appear and disappear slowly. These are very crude scripts and they can be improved.

   # change alpha values for all solid colors.
   proc change_alpha {newval} {
     set num [colorinfo num] 
     for {set i 0} {$i < $num} {incr i} {
       color change alpha $i $newval
     }
   }

   # vary the alpha value from 0 to 1 thus forcing an object to slowly
   # appear on the screen.
   proc fade_in {} {
     for {set i 0} {$i < 1} {set i [expr $i + 0.05]} {
       change_alpha $i
     }
   }



Sergei Izrailev
Fri Jul 25 17:07:27 CDT 1997