def changeOrientation(self, angle, axis):
     """
     aktualisiere die Orientierung der Arcball rotation
     @param angle: winkel um den gedreht wird
     @param axis: achse um die gedreht wurde
     """
     self.actOri = self.actOri * geo.rotate(angle, axis)
 def rotate(self, angle, axis):
     """
     rotiere die aktuelle Orientierung
     @param angle: winkel der Transformation
     @param axis: Achse um die gedreht wird
     """
     self.rotation = self.actOri * geo.rotate(angle, axis)
Пример #3
0
def mousebuttonpressed(button, state, x, y):
    """ Callback Function for Mouse-Event """
    global startP, actOri, angle, doRotation, doZoom, startPoint, doTranslate, fixedPoint
    r = min(WIDTH, HEIGHT) / 2.0
    if button == GLUT_LEFT_BUTTON:
        doZoom, doTranslate = False, False
        if state == GLUT_DOWN:
            doRotation = True
            startP = geo.projectOnSphere(x, y, r, WIDTH, HEIGHT)
        if state == GLUT_UP:
            doRotation = False
            actOri = actOri * geo.rotate(angle, axis)
            angle = 0
def mousebuttonpressed(button, state, x, y):
    """ Callback Function for Mouse-Event """
    global startP, actOri, angle, doRotation, doZoom, startPoint, doTranslate, fixedPoint
    r = min(WIDTH, HEIGHT) / 2.0
    if button == GLUT_LEFT_BUTTON:
        doZoom, doTranslate = False, False
        if state == GLUT_DOWN:
            doRotation = True
            startP = geo.projectOnSphere(x, y, r, WIDTH, HEIGHT)
        if state == GLUT_UP:
            doRotation = False
            actOri = actOri * geo.rotate(angle, axis)
            angle = 0