Changeset 8560:96f24cf2b70c in orange


Ignore:
Timestamp:
08/01/11 20:03:03 (3 years ago)
Author:
matejd <matejd@…>
Branch:
default
Convert:
7d816ff4c183acab0fa23c4b269362ef22392401
Message:

Shift+middle button translation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot3d.py

    r8559 r8560  
    13851385        elif self.state == PlotState.ROTATING: 
    13861386            if QApplication.keyboardModifiers() & Qt.ShiftModifier: 
    1387                 off_x = numpy.cross(self.camera, [0, 1, 0]) * (dx / self.move_factor) 
    1388                 #off_y = numpy.cross(self.camera, [1,0,0]) * (dy / self.move_factor) 
    1389                 # TODO: this incidentally works almost fine, but the math is wrong and should be fixed 
    1390                 #self.data_center += off_x 
     1387                right_vec = normalize(numpy.cross(self.camera, [0, 1, 0])) 
     1388                up_vec = normalize(numpy.cross(right_vec, self.camera)) 
     1389                right_scale = self.width()*max(self.scale[0], self.scale[2])*0.1 
     1390                up_scale = self.height()*self.scale[1]*0.1 
     1391                self.translation -= right_vec*(dx / right_scale) +\ 
     1392                                    up_vec*(dy / up_scale) 
    13911393            else: 
    13921394                self.yaw += dx / (self.rotation_factor*self.width()) 
Note: See TracChangeset for help on using the changeset viewer.