VMD-L Mailing List
From: Justin Gullingsrud (justin_at_ks.uiuc.edu)
Date: Wed Jun 18 2003 - 09:22:42 CDT
- Next message: John Stone: "Re: amber trajectory"
- Previous message: Oscar Moran: "amber trajectory"
- In reply to: #WONG CHEE HOW#: "Colouring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
On Wed, Jun 18, 2003 at 02:02:39PM +0800, #WONG CHEE HOW# wrote:
> Hi,
>
> I am using VMD1.8 and wondering is it possible that the program will allow me to colour the space enclosed by, say, 6 atoms bonded together? In addition, if I have 1200 atoms all randomly inside a cube of 10 angstrom x 10 angstrom x 10 angstrom, is it possible to make VMD only display the atoms at the top half, bottom half, left hand side, or right hand side of the cube as I desired?
>
Hi,
You could draw a triangle for each set of three atoms in the set, with vertices
at those atoms; that way you would be guaranteed to enclose the space. A
script for that would look something like:
set sel [atomselect top "my six atoms"]
set atompos [$sel get {x y z}]
set n [$sel num]
for { set i 0 } { $i < $n } { incr i } {
set pi [lindex $atompos $i]
for { set j [expr $i + 1] } { $j < $n } { incr j } {
set pj [lindex $atompos $j]
for { set k [expr $j + 1] } { $k < $n } { incr k } {
set pk [lindex $atompos $k]
draw triangle $pi $pj $pk
}
}
}
BTW, you can delete all the triangles with "draw delete all". To draw in
a different color, enter "draw color red" or whatever before you start
drawing (i.e. just before the first for loop).
For the atoms in the cube, that's easy: just select "x < 0", "y > 0", etc.
assuming the box is centered at the origin. If not you'll have to adjust
the position of the cutoff accordingly.
Cheers,
Justin
> Thanks in advance.
>
> Regards,
> CH WONG
-- Justin Gullingsrud 3111 Beckman Institute 217-244-8946 I been dropping the new science, and I be kicking the new knowledge, and I'm seeing to a degree that you can't get in college. -- b.boys
- Next message: John Stone: "Re: amber trajectory"
- Previous message: Oscar Moran: "amber trajectory"
- In reply to: #WONG CHEE HOW#: "Colouring"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]