This is a read-only mirror of pymolwiki.org

Difference between revisions of "RUCAP UM-5"

From PyMOL Wiki
Jump to navigation Jump to search
Line 47: Line 47:
 
* '''RUCAP UM-5 tracker:''' http://rucap.ru/en/um5/about
 
* '''RUCAP UM-5 tracker:''' http://rucap.ru/en/um5/about
  
=== PyMol Script ===
+
=== PyMol Script of [[ImmersiveViz]] ===
 
* '''Project Page:''' http://code.google.com/p/immersive-viz/
 
* '''Project Page:''' http://code.google.com/p/immersive-viz/
 
* '''Source:''' [http://code.google.com/p/immersive-viz/source/browse/trunk/MolViz.py here] and [http://code.google.com/p/immersive-viz/source/browse here]
 
* '''Source:''' [http://code.google.com/p/immersive-viz/source/browse/trunk/MolViz.py here] and [http://code.google.com/p/immersive-viz/source/browse here]
 
* '''Instructions:''' [http://code.google.com/p/immersive-viz/ here] and [http://code.google.com/p/immersive-viz/wiki/UserManual here]
 
* '''Instructions:''' [http://code.google.com/p/immersive-viz/ here] and [http://code.google.com/p/immersive-viz/wiki/UserManual here]

Revision as of 20:35, 10 May 2013

RUCAP UM-5 tracker

RUCAP UM-5 tracker is a wireless joystick for view control in PyMol.

Getting UM-5 Data into your Script

# -*- coding: cp1251
from ctypes import *


RUCAP_VERSION = 3
RUCAP_RESULT_OK = 0;
RUCAP_RESULT_FAIL = 1;
RUCAP_RESULT_TRACKERAPP_OFF = 2;
RUCAP_RESULT_UNPLUGGED = 3;
RUCAP_RESULT_DEVICE_NOT_CREATED = 4;
RUCAP_RESULT_BAD_VERSION = 5;

# load dll
a = CDLL("rucap.dll")
# call function, that returned int
a.RucapCreateDevice.restype = c_int
print "RucapCreateDevice:"
print a.RucapCreateDevice(c_int(RUCAP_VERSION))

# initialisation of device
if (a.RucapCreateDevice(c_int(RUCAP_VERSION)) == RUCAP_RESULT_OK): print "Can`t create ruCap device\n"

a.RucapGetHeadPos.restype = c_int
x = c_float(0.0)
y = c_float(0.0)
z = c_float(0.0)

# main loop
while (1) :
    if a.RucapGetHeadPos(byref(x),byref(y),byref(z)):
        print "No Position!"
    else :
        #print '%f %f %f\n' % ( x.value, y.value, z.value)
        print x.value, y.value, z.value

Availability

Additional Information

PyMol Script of ImmersiveViz