def updateImage(): global canvas, Lines global Trained, canvasSize, StepSize, AnimationPercent noSelection = -1 currentImage = None vertices = VertexUtils.computeVertices(Trained, StepSize, AnimationPercent) vertices = VertexUtils.translateVertices( VertexUtils.scaleVertices(vertices, canvasSize / 4), canvasSize * 2.0 / 3, canvasSize * 2.0 / 3 ) Utils.UpdateImage(canvas, 0, 0, vertices, Lines, currentImage, noSelection, noSelection)
def updateImage(): global canvas, Lines global Trained, canvasSize, StepSize, AnimationPercent noSelection = -1 currentImage = None vertices = VertexUtils.computeVertices(Trained, StepSize, AnimationPercent) vertices = VertexUtils.translateVertices( VertexUtils.scaleVertices(vertices, canvasSize / 4), canvasSize * 2. / 3, canvasSize * 2. / 3) Utils.UpdateImage(canvas, 0, 0, vertices, Lines, currentImage, noSelection, noSelection)
StepArgument = 0.55 StepArgument = 1.25 width, height = 800, 300 MinStepArgument, MaxStepArgument, Lines, Trained = loadData( "../data/results/learned.json", "../data/results/stepWidth.json") walker = SimpleWalker(Trained, StepArgument) refVertexIndex = getVertexIndex(Trained, "reference-floor") stepCount = 10 stepIncrement = 0.1 for i in range(int(math.ceil(stepCount / stepIncrement))): walker.moveForward(stepIncrement) vertices = walker.getVertices() vertices = VertexUtils.translateVertices( VertexUtils.scaleVertices(vertices, height / 4), width / 10, height * 2. / 3) im = Utils.DrawFrame(None, width, height, 0, 0, vertices, Lines, None, None, refVertexIndex) im.save("imgs/frame" + format(i, "03") + ".jpg") subprocess.call([ "convert", "-delay", "5", "-loop", "0", "../img/frame*.jpg", "../img/animation.gif" ])
StepArgument = 0.55 StepArgument = 1.25 width, height = 800, 300 MinStepArgument, MaxStepArgument, Lines, Trained = loadData("../data/results/learned.json", "../data/results/stepWidth.json") walker = SimpleWalker(Trained, StepArgument) refVertexIndex = getVertexIndex(Trained, "reference-floor") stepCount = 10 stepIncrement = 0.1 for i in range(int(math.ceil(stepCount / stepIncrement))): walker.moveForward(stepIncrement) vertices = walker.getVertices() vertices = VertexUtils.translateVertices( VertexUtils.scaleVertices(vertices, height / 4), width / 10, height * 2. / 3) im = Utils.DrawFrame(None, width, height, 0, 0, vertices, Lines, None, None, refVertexIndex) im.save("imgs/frame" + format(i, "03") + ".jpg") subprocess.call(["convert", "-delay", "5", "-loop", "0", "../img/frame*.jpg", "../img/animation.gif"])