Wednesday, January 05, 2011

VPythonで螺旋を描画する

VPythonで螺旋を描画するには、以下のコードを実行します。

# coding=UTF-8
from visual import *
# 螺旋を作成
helix1 = helix(pos=(0, 0, 0), radius=0.6,
color=(0x99/255.,0xdd/255.,0xff/255.))


出力画面


動作環境
Python 3.1.3, VPython 5.41

Sunday, January 02, 2011

VPythonで矢印を描画する

VPythonで矢印を描画するには、以下のコードを実行します。

# coding=UTF-8
from visual import *
# 矢印を作成
arrow1 = arrow(pos=(0, 0, 0), shaftwidth=1,
color=(0x99/255.,0xdd/255.,0xff/255.))
# 回転
arrow1.rotate(angle=pi*110./180., axis=(1,0,1))


実行画面


動作環境
Python 3.1.3, VPython 5.41