When you run the following code using VPython's VIdle on Windows, an interactive window pops up where you can rotate the scene by holding down the right mouse button:
from visual import *Does anyone know a different way to draw and interact with 3D vectors?
floor = box(pos=(0,0,0), length=4, width=4,
height=0.01, color=color.blue)
xaxis = arrow(pos=(0,0,0), axis=(1,0,0), color=color.green)
yaxis = arrow(pos=(0,0,0), axis=(0,1,0), color=color.red)
2 comments:
You can draw vectors like this in VMD. See http://www.ks.uiuc.edu/Research/vmd/current/ug/node123.html . I have no idea if the Python API supports the "draw" commands.
We use vmd to draw vectors, we hacked together a handy little tcl script which draws the vector with the origin on a given atom and draws a label at the end.
It's extra nice since you can easily draw orbitals and stuff in VMD also.
Post a Comment