z向上的正确方向

时间:2014-02-13 09:40:51

标签: vpython

如何使轴x,y,z看起来像

enter image description here

from visual import *

f = frame()

# Axis
pointer_x = arrow(frame=f, pos=(0,0,0), axis=(40,0,0), shaftwidth=1, color = color.red)
pointer_y = arrow(frame=f, pos=(0,0,0), axis=(0,40,0), shaftwidth=1, color = color.blue)
pointer_z = arrow(frame=f, pos=(0,0,0), axis=(0,0,40), shaftwidth=1, color = color.green)

# Show X,Y,Z labels
label(frame=f,pos=(40,0,0), text='X')
label(frame=f,pos=(0,40,0), text='Y')
label(frame=f,pos=(0,0,40), text='Z')

1 个答案:

答案 0 :(得分:1)

这个代码解决了它,如果有更好的方法评论它。

# Show it like ECEF
f.rotate(angle=radians(-90),axis=(1,0,0),origin=(0,0,0))
f.rotate(angle=radians(180),axis=(0,1,0),origin=(0,0,0))