Beispiel #1
0
    def __init__(self, *args, **kwargs):
        self.cube = CubeVisual(size=(0.8, 0.5, 0.5),
                               color='red',
                               edge_color="k")
        self.theta = 0
        self.phi = 0
        self.cube_transform = transforms.MatrixTransform()
        self.cube.transform = self.cube_transform

        self._timer = Timer('auto', connect=self.on_timer, start=True)
        SceneCanvas.__init__(self, *args, **kwargs)
Beispiel #2
0
    def __init__(self):
        app.Canvas.__init__(self, 'Cube', keys='interactive', size=(400, 400))

        self.cube = CubeVisual((1.0, 0.5, 0.25),
                               color='red',
                               edge_color='black')
        self.cube.transform = transforms.MatrixTransform()
        self.cube.transform.scale((100, 100, 0.001))
        self.cube.transform.translate((200, 200))

        self.quaternion = Quaternion()
        self.show()
    def __init__(self, connection, orientation):
        self.con = connection
        self.orientation = orientation
        app.Canvas.__init__(self, 'Cube', keys='interactive', size=(400, 400))
        self.cube = CubeVisual((7.0, 4.0, 0.3),
                               color=Color(color='grey', alpha=0.1,
                                           clip=False),
                               edge_color="black")

        # Create a TransformSystem that will tell the visual how to draw
        self.cube_transform = transforms.MatrixTransform()
        self.cube.transform = self.cube_transform
        self._timer = app.Timer('0.05', connect=self.on_timer, start=True)
        self.show()
Beispiel #4
0
    def __init__(self):
        app.Canvas.__init__(self, 'Cube', keys='interactive', size=(400, 400))

        self.cube = CubeVisual((1.0, 0.5, 0.25), color='red', edge_color="k")
        self.theta = 0
        self.phi = 0

        # Create a TransformSystem that will tell the visual how to draw
        self.cube_transform = transforms.MatrixTransform()
        self.cube.transform = self.cube_transform

        self._timer = app.Timer('auto', connect=self.on_timer, start=True)

        self.show()
Beispiel #5
0
    def __init__(self):
        app.Canvas.__init__(self, 'Cube', keys='interactive',
                            size=(400, 400))

        self.cube = CubeVisual((1.0, 0.5, 0.25), color='red',
                               edge_color='black')
        self.quaternion = Quaternion()

        # Create a TransformSystem that will tell the visual how to draw
        self.cube_transform = transforms.AffineTransform()
        self.cube_transform.scale((100, 100, 0.001))
        self.cube_transform.translate((200, 200))
        self.tr_sys = transforms.TransformSystem(self)
        self.tr_sys.visual_to_document = self.cube_transform
        self.show()
Beispiel #6
0
    def __init__(self):
        self.cube = CubeVisual((1.0, 0.5, 0.25),
                               color='red',
                               edge_color='black')
        self.theta = 0
        self.phi = 0

        app.Canvas.__init__(self,
                            'Cube',
                            keys='interactive',
                            show=True,
                            size=(400, 400))

        # Create a TransformSystem that will tell the visual how to draw
        self.cube_transform = transforms.AffineTransform()
        self.tr_sys = transforms.TransformSystem(self)
        self.tr_sys.visual_to_document = self.cube_transform

        self._timer = app.Timer('auto', connect=self.on_timer, start=True)