diff options
author | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-12 12:17:55 -0400 |
---|---|---|
committer | Anthony LaTorre <tlatorre9@gmail.com> | 2011-09-12 12:17:55 -0400 |
commit | 4b5d9c633bd01ce8b2819d92eaf3e01d881fb996 (patch) | |
tree | da470feea0cf990a0585ef89c8b3091ffa32a660 | |
parent | f3e5eee5f555787230e22eb47600b5767d6b19da (diff) | |
download | chroma-4b5d9c633bd01ce8b2819d92eaf3e01d881fb996.tar.gz chroma-4b5d9c633bd01ce8b2819d92eaf3e01d881fb996.tar.bz2 chroma-4b5d9c633bd01ce8b2819d92eaf3e01d881fb996.zip |
fix space navigator controls.
-rwxr-xr-x | camera.py | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -593,30 +593,25 @@ class Camera(multiprocessing.Process): accelerate_factor = 2.0 else: accelerate_factor = 1.0 - #print 'raw:', spnav_event - v1 = self.axis2 - v2 = self.axis1 - v3 = -np.cross(self.axis1,self.axis2) + + v1 = self.axis1 + v2 = self.axis2 + v3 = np.cross(self.axis1,self.axis2) - v = -v1*spnav_event.motion.x + v2*spnav_event.motion.y \ - + v3*spnav_event.motion.z + v = v2*spnav_event.motion.x + v1*spnav_event.motion.y + \ + v3*spnav_event.motion.z v *= self.scale / 5000.0 * accelerate_factor - #print 'translate:', v self.translate(v, redraw=False) - axis = v1*spnav_event.motion.rx + -v2*spnav_event.motion.ry \ - + -v3*spnav_event.motion.rz + axis = -v2*spnav_event.motion.rx - v1*spnav_event.motion.ry - \ + v3*spnav_event.motion.rz - # Zero all but non-max values - #axis[~(np.abs(axis) == np.abs(axis).max())] = 0 - #axis[np.abs(axis) < 15] = 0 if (axis != 0).any(): axis = axis.astype(float) length = np.linalg.norm(axis) angle = length * 0.0001 * accelerate_factor axis /= length - #print 'rotate:', angle, axis self.rotate_around_point(angle, axis, self.point, redraw=False) |