File: cgo01.py

package info (click to toggle)
pymol 1.8.4.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 42,248 kB
  • ctags: 24,095
  • sloc: cpp: 474,635; python: 75,034; ansic: 22,888; sh: 236; makefile: 78; csh: 21
file content (32 lines) | stat: -rw-r--r-- 583 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from pymol.cgo import *
from pymol import cmd

# this is a trivial example of creating a cgo object consisting of a
# a single state 

# first we create a list of floats containing a GL rendering stream

obj = [
   BEGIN, LINES,
   COLOR, 1.0, 1.0, 1.0,
   
   VERTEX, 0.0, 0.0, 0.0,
   VERTEX, 1.0, 0.0, 0.0,
   
   VERTEX, 0.0, 0.0, 0.0,
   VERTEX, 0.0, 2.0, 0.0,
   
   VERTEX, 0.0, 0.0, 0.0,
   VERTEX, 00, 0.0, 3.0,

   END
   ]

# then we load it into PyMOL

cmd.load_cgo(obj,'cgo01')

# move the read clipping plane back a bit to that that is it brighter

cmd.clip('far',-5)