首页 > 编程语言 > 详细

VPython 三维显示 —— hello word

时间:2016-10-09 23:03:27      阅读:816      评论:0      收藏:0      [点我收藏+]

使用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

原文:http://www.cnblogs.com/fly2wind/p/5943970.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!