On Windows XP SP3 (Python 2.5.1, VPython 3.2.11), the following use of
frame() gives an unexpected flip in the y- and z-axes in some of the
frames.
By uncommenting the line:
if costh<0: Fup=-Fup
I get the desired behavior.
Is this a bug?
Rob Salgado
# example of frame()
from visual import *
scene.background=(.5,.5,.5)
scene.forward=(0,20,-10)
DEG=math.pi/180.
F=[]
for th in arange(0,360*DEG, 30*DEG):
costh=cos(th)
sinth=sin(th)
Fup=scene.up
#if costh<0: Fup=-Fup
F.append(frame(pos=6*norm( vector(costh, sinth, 0) ),
axis=vector(costh,sinth,0) , up=Fup))
arrow(frame=F[-1],color=color.red, axis=vector(1,0,0) )
arrow(frame=F[-1],color=color.green, axis=vector(0,1,0) )
arrow(frame=F[-1],color=color.blue, axis=vector(0,0,1) )
label(frame=F[-1],text="%3d" % round(th/DEG) ,box=0, opacity=0)
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
|