コード例 #1
0
ファイル: tree.py プロジェクト: a5kin/a5kin.github.io
 def draw(self, *args):
     """Redraw the whole app."""
     self.ctx.clear()
     for obj in self.objects[::-1]:
         obj.update()
         obj.draw()
     window.requestAnimationFrame(self.draw)
コード例 #2
0
 def anim_rot_loop(self, ts):
     has_chg, rot = self.get_anim_ref(ts, self.params['anim_step'])
     if has_chg and self.params['anim']:
         self.params['rotate'] = rot
         self.transform()
     if self.params['anim']:
         window.requestAnimationFrame(self.anim_rot_loop)
コード例 #3
0
def animate(i):
    # note: three.js includes requestAnimationFrame shim
    window.requestAnimationFrame(animate)
    controls.update()
    mesh.rotation.x += 0.01
    # mesh.rotation.y += 0.02;
    renderer.render(scene, camera)
コード例 #4
0
 def on_update(data, ack):
     data = JSON.parse(data)
     Game().updates = data['updates']
     Game().new_bots = data['bots']
     Game().time = data['time']
     Game().started = data['started']
     window.requestAnimationFrame(Game().draw)
     ack()
コード例 #5
0
 def anim_path_loop(self, ts):
     has_chg, pt = self.get_anim_ref(ts, self.params['anim_step'])
     if has_chg and self.params['anim']:
         x, y = pt
         self.elm.left = x
         self.elm.top = y
     if self.params['anim']:
         window.requestAnimationFrame(self.anim_path_loop)
コード例 #6
0
ファイル: stars.py プロジェクト: wapringle/airpollution
 def drawFrame(timestamp):
     global tsave, nxt
     if nxt < 200:
         window.requestAnimationFrame(drawFrame)
     if tsave == 0.0:
         tsave = timestamp
     else:
         displayPic2(timestamp - tsave)  #,v,ctx,frames,q)
コード例 #7
0
ファイル: app.py プロジェクト: a5kin/a5kin.github.io
 def draw(self, *args):
     """Redraw the whole app."""
     self.ctx.clear()
     for circle in self.excentrics:
         self.ctx.beginFill(circle.color, circle.opacity)
         self.ctx.drawCircle(circle.x, circle.y, circle.r)
         self.ctx.endFill()
         circle.update()
     window.requestAnimationFrame(self.draw)
コード例 #8
0
 def anim_scl_loop(self, ts):
     has_chg, pt = self.get_anim_ref(ts, self.params['anim_step'])
     if has_chg and self.params['anim']:
         x, y = pt
         self.params['scaleX'] = x / 100.0
         self.params['scaleY'] = y / 100.0
         self.transform()
     if self.params['anim']:
         window.requestAnimationFrame(self.anim_scl_loop)
コード例 #9
0
ファイル: stars.py プロジェクト: wapringle/airpollution
    def drawFrame(timestamp):
        window.requestAnimationFrame(drawFrame)
        ctx.clearRect(0, 0, canvas.width, canvas.height)
        ctx.strokeRect(0, 0, canvas.width, canvas.height)
        ctx.fillStyle = "#99f9ea"
        ctx.fillRect(0, 0, canvas.width, canvas.height)
        """ Draw shapes and update """

        for s in shapeList:
            s.draw(ctx)
            s.update(timestamp)
コード例 #10
0
ファイル: threejs_robot1.py プロジェクト: b51382909/2015cphw
def animate(i):
    # note: window.THREE.js includes requestAnimationFrame shim
    window.requestAnimationFrame( animate )

    #mesh.rotation.x += 0.05
    #mesh.rotation.y += 0.1
    doc["console"].value = ""
    print("forearm.rotation.z:", forearm.rotation.z)
    print("forearm.rotation.y:", forearm.rotation.y)
    forearm.rotation.y += 0.1
    forearm.rotation.z += 0.1

    renderer.render( scene, camera )  
コード例 #11
0
def request_animation_frame(func):
    return int(window.requestAnimationFrame(func))
コード例 #12
0
ファイル: code.py プロジェクト: tiagoantao/brython-toys
def render():
    global direction
    window.requestAnimationFrame(render)
    renderer.render(scene, camera)
コード例 #13
0
def animloop(t):
    global run
    run = window.requestAnimationFrame(animloop)
    render()
コード例 #14
0
ファイル: game-engine.py プロジェクト: lsoaresesilva/32bits
    def desenhar(self, *args):
        self.ctx.clearRect(0, 0, canvas.width, canvas.height)
        for objeto in self.objetosDesenhados:
            objeto.desenhar()

        window.requestAnimationFrame(self.desenhar)
コード例 #15
0
 def queue(self):
     window.requestAnimationFrame(self.loop)
コード例 #16
0
 def init_anim(self, ar, f):
     self.params['anim_ar'] = ar
     self.params['anim'] = True
     self.params['refts'] = None
     self.backup_state()
     window.requestAnimationFrame(f)
コード例 #17
0
ファイル: editor.py プロジェクト: jeysonmc/brython-components
 def refresh(self):
     window.requestAnimationFrame(self._refresh)
コード例 #18
0
 def queue(self):
     window.requestAnimationFrame(self.loop)
コード例 #19
0
ファイル: threejs_robot2.py プロジェクト: b51382909/2015cphw
def animate(i):
    window.requestAnimationFrame( animate )
    forearm.rotation.y += 0.1
    forearm.rotation.z += 0.1
    renderer.render( scene, camera )