VPython 三维显示 —— hello word

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VPython 三维显示 —— hello word相关的知识,希望对你有一定的参考价值。

使用VPython,python(x,y)中已安装VPython模块

  1. from visual import *
  2. cylinder(pos=(0,1,0), axis=(0,1,0), radius=0.1, color=(0,1,0))
  3. box = box(length=4, height=0.5, width=4, color=color.blue)
  4. ball = sphere(pos=(0,4,0), color=color.red)

窗口交互

  • 拖动右键切换角度(rotate)
  • 同时按住左键右键拖动缩放窗口 (和滚轮缩放不同……)

主要资料

官网doc

http://vpython.org/contents/docs/display.html

官网示例代码

安装目录下文件夹中





以上是关于VPython 三维显示 —— hello word的主要内容,如果未能解决你的问题,请参考以下文章