• R/O
  • SSH

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂bd8fc014e2e9126789abf0ab52c83b978a33d07c (tree)
時間2021-09-17 23:25:23
作者Lorenzo Isella <lorenzo.isella@gmai...>
CommiterLorenzo Isella

Log Message

A simple python code to produce an animation.

Change Summary

差異

diff -r 6540e33d2287 -r bd8fc014e2e9 Python-codes/animation_mayavi.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Python-codes/animation_mayavi.py Fri Sep 17 16:25:23 2021 +0200
@@ -0,0 +1,15 @@
1+#! /usr/bin/env python3
2+
3+import numpy as np
4+from mayavi import mlab
5+x, y = np.mgrid[0:3:1,0:3:1]
6+s = mlab.surf(x, y, np.asarray(x*0.1, 'd'))
7+
8+@mlab.animate
9+def anim():
10+ for i in range(10):
11+ s.mlab_source.scalars = np.asarray(x*0.1*(i+1), 'd')
12+ yield
13+
14+anim()
15+mlab.show()