From: Adrian Roitberg (roitberg_at_qtp.ufl.edu)
Date: Fri Mar 02 2007 - 10:11:08 CST

Dear all,

I hacked a bit one of Axel Kohlmeyer wonderful scripts to be able to
visualize gaussian cube files in sequence.

His original script did electron density, but I need the HOMO vs time.

The problem is that I need to create 3 representations, 1 for the
molecule itself, one for positive isosurfaces and one for negative.
I can do that. However, they both come out in gray color, while I need
them, let's say red and blue.

I also do not know how to make them transparent.

I can do this for single snapshots with no trouble.

Any help is appreciated.

-- 
                            Dr. Adrian E. Roitberg
                              Associate Professor
               Quantum Theory Project and Department of Chemistry
University of Florida                         PHONE 352 392-6972
P.O. Box 118435                               FAX   352 392-8722
Gainesville, FL 32611-8435                    Email adrian_at_qtp.ufl.edu
============================================================================
To announce that there must be no criticism of the president,
or that we are to stand by the president right or wrong,
is not only unpatriotic and servile, but is morally treasonable
to the American public."
   --  Theodore Roosevelt

# $Id: au-iso.vmd,v 1.2 2004/05/21 15:50:29 akohlmey Exp $
# Display settings
display projection Orthographic
display nearclip set 0.000000
display farclip set 10.000000
display depthcue off
# store the molecule id for later use
set updmol [mol new {02.cube} type cube waitfor all]
mol addfile {03.cube} type cube waitfor all
mol addfile {04.cube} type cube waitfor all
mol addfile {05.cube} type cube waitfor all
mol addfile {06.cube} type cube waitfor all
mol addfile {07.cube} type cube waitfor all
mol addfile {08.cube} type cube waitfor all
mol addfile {09.cube} type cube waitfor all
mol addfile {10.cube} type cube waitfor all
mol addfile {11.cube} type cube waitfor all
mol addfile {12.cube} type cube waitfor all
mol addfile {13.cube} type cube waitfor all
mol addfile {14.cube} type cube waitfor all
mol addfile {15.cube} type cube waitfor all
mol addfile {16.cube} type cube waitfor all
mol addfile {17.cube} type cube waitfor all
mol addfile {27.cube} type cube waitfor all
mol addfile {37.cube} type cube waitfor all
mol addfile {47.cube} type cube waitfor all
mol addfile {49.cube} type cube waitfor all

# Representation 0: The molecule
mol delrep 0 top
mol representation licorice
mol color Name
mol selection {all}
mol addrep top

# Representation 1: Positive isosurface
mol representation Isosurface 0.020000 0.000000 0.000000 1.000000
mol color ColorID 0
mol selection {all}
mol addrep top

# Representation 2: Negative isosurface
mol representation Isosurface -0.02 1.0 0.0 0.0
mol color ColorID 1
mol selection {all}
mol addrep top

set updrep1 [mol repname top 1]
set updrep2 [mol repname top 2]
mol rename top {test}

# use the volumetric data set for the isosurface corresponding to the frame.
# $updmol contains the id of the molecule and $updrep the (unique) name of
# the isosurface representation
#
proc update_iso {args} {
    global updmol
    global updrep1
    global updrep2

    # get representation id and return if invalid
    set repid1 [mol repindex $updmol $updrep1]
    if {$repid1 < 0} { return }
    set repid2 [mol repindex $updmol $updrep2]
    if {$repid2 < 0} { return }

    # update representation but replace the data set
    # id with the current frame number.
    set frame [molinfo $updmol get frame]
    lassign [molinfo $updmol get "{rep $repid1}"] rep
    mol representation [lreplace $rep 2 2 $frame]
    mol modrep $repid1 $updmol

    lassign [molinfo $updmol get "{rep $repid2}"] rep
    mol representation [lreplace $rep 2 2 $frame]
    mol modrep $repid2 $updmol
}

trace variable vmd_frame($updmol) w update_iso
animate goto 0