개발이야기

PyMOL 함수 만들어 보기

준호준호씨 2011. 3. 23. 18:25
반응형

image

중간에 흰 선이 보이는가? 어렵사리 이까지 왔다 –_-; opengl 함수를 바로 이용 할 수 있는 방법은 없는지 모르겠다.

코드는 대략 이러하다

def mytest():
    print "hello"

    r=1.0
    g=1.0
    b=1.0
    linewidth=2.0
    boundingBox = [
        LINEWIDTH, float(linewidth),
        BEGIN, LINES,
        COLOR, float(r), float(g), float(b),
        VERTEX, 2.0, 2.0, 2.0,
        VERTEX, 4.0, 4.0, 4.0,
        END
    ]
    boxName = "box_" + str(randint(0,10000))
    print boxName
    cmd.load_cgo(boundingBox,boxName)
    return boxName

이거도 http://www.pymolwiki.org/index.php/DrawBoundingBox 참고해서 만든 것이다.

load_cgo 함수 주석을 보면

"load_cgo" is used to load a compiled graphics object, which is actually a list of floating point numbers built using the constants in the $PYMOL_PATH/modules/pymol/cgo.py file.

이렇게 적혀 있다.

아직 갈 길이 멀구나. 잘 아시는 분이나 유용한 정보 가지고 계신분은 좀 가르쳐 주시길…

반응형