Beispiel #1
0
    def model_matrix(self):
        phase = (pygame.time.get_ticks() - self.phase) / 1000.0
        if self.flip: phase *= -1

        offset = Matrix.translate(-0.5, -0.5)
        translate = Matrix.translate(self.pos.x + 0.5, self.pos.y + 0.5)
        scale = Matrix.scale(2.2, 2.2)
        rotate = Matrix.rotatez(phase * 1.0)

        return np.dot(offset, np.dot(rotate, np.dot(scale, translate)))