Exemplo n.º 1
0
    def setCameraCenterViewDistance(self, center, view='front', distance=10):

        human = self.selectedHuman
        tl = animation3d.Timeline(0.20)
        cam = self.modelCamera
        if view == 'front':
            tl.append(animation3d.CameraAction(self.modelCamera, None,
                [center[0], center[1], distance,
                center[0], center[1], 0,
                0, 1, 0]))
        elif view == 'top':
            tl.append(animation3d.CameraAction(self.modelCamera, None,
                [center[0], center[1] + distance, center[2],
                center[0], center[1], center[2],
                0, 0, -1]))
        elif view == 'left':
            tl.append(animation3d.CameraAction(self.modelCamera, None,
                [center[0] - distance, center[1], center[2],
                center[0], center[1], center[2],
                0, 1, 0]))
        elif view == 'right':
            tl.append(animation3d.CameraAction(self.modelCamera, None,
                [center[0] + distance, center[1], center[2],
                center[0], center[1], center[2],
                0, 1, 0]))
        tl.append(animation3d.PathAction(human, [human.getPosition(), [0.0, 0.0, 0.0]]))
        tl.append(animation3d.RotateAction(human, human.getRotation(), [0.0, 0.0, 0.0]))
        tl.append(animation3d.UpdateAction(self))
        tl.start()
Exemplo n.º 2
0
    def setGlobalCamera(self):
        human = self.selectedHuman

        tl = animation3d.Timeline(0.20)
        tl.append(animation3d.PathAction(self.modelCamera, [self.modelCamera.getPosition(), [0.0, 0.0, 0.0]]))
        tl.append(animation3d.RotateAction(self.modelCamera, self.modelCamera.getRotation(), [0.0, 0.0, 0.0]))
        tl.append(animation3d.ZoomAction(self.modelCamera, self.modelCamera.zoomFactor, 1.0))
        tl.append(animation3d.UpdateAction(self))
        tl.start()
Exemplo n.º 3
0
 def resetView(self):
     cam = self.modelCamera
     animation3d.animate(self, 0.20, [
         self.rotateAction([0.0, 0.0, 0.0]),
         animation3d.PathAction(
             self.modelCamera,
             [self.modelCamera.getPosition(), [0.0, 0.0, 0.0]]),
         animation3d.ZoomAction(self.modelCamera,
                                self.modelCamera.zoomFactor, 1.0)
     ])
Exemplo n.º 4
0
    def setGlobalCamera(self):

        human = self.selectedHuman

        tl = animation3d.Timeline(0.20)
        cam = self.modelCamera
        tl.append(animation3d.CameraAction(self.modelCamera, None, [0,0,60, 0,0,0, 0,1,0]))
        tl.append(animation3d.PathAction(human, [human.getPosition(), [0.0, 0.0, 0.0]]))
        tl.append(animation3d.RotateAction(human, human.getRotation(), [0.0, 0.0, 0.0]))
        tl.append(animation3d.UpdateAction(self))
        tl.start()
Exemplo n.º 5
0
    def focusOn(self, pos, direction, zoomFactor, animate = True):
        translation = self._getTranslationForPosition(pos)
        rot, incl = getRotationForDirection(direction)

        if animate:
            import animation3d
            tl = animation3d.Timeline(0.20)
            tl.append(animation3d.PathAction(self, [self.getPosition(), translation]))
            tl.append(animation3d.RotateAction(self, self.getRotation(), [incl, rot, 0.0]))
            tl.append(animation3d.ZoomAction(self, self.zoomFactor, zoomFactor))
            tl.append(animation3d.UpdateAction(G.app))
            tl.start()
        else:
            self.translation = translation
            self.horizontalRotation = rot
            self.verticalInclination = incl
            self.setZoomFactor(zoomFactor)