def main(env,options):
"Main example code."
spinner = None
try:
handles = []
handles.append(env.plot3(points=array(((-1.5,-0.5,0),(-1.5,0.5,0))),
pointsize=15.0,
colors=array(((0,1,0),(0,0,0)))))
handles.append(env.plot3(points=array((-1.5,-1,0)),
pointsize=25.0,
colors=array(((0,0,1,0.2)))))
handles.append(env.drawlinestrip(points=array(((-1.25,-0.5,0),(-1.25,0.5,0),(-1.5,1,0))),
linewidth=3.0,
colors=array(((0,1,0),(0,0,1),(1,0,0)))))
handles.append(env.plot3(points=array(((-0.5,-0.5,0),(-0.5,0.5,0))),
pointsize=0.05,
colors=array(((0,1,0),(1,1,0))),
drawstyle=1))
handles.append(env.drawtrimesh(points=array(((0,0,0),(0.5,0,0),(0,0.5,0))),
indices=None,
colors=array(((0,1,0),(0,0,1),(1,0,0)))))
handles.append(env.drawtrimesh(points=array(((0,0,0.5),(0.5,0,0.5),(-0.5,0.5,0.5),(1,0.5,0.5))),
indices=array(((0,1,2),(2,1,3)),int64),
colors=array((1,0,0,0.5))))
handles.append(env.plot3(points=array(((0.5,0,1.0),(-0.5,0,1.0))),
pointsize=45.0,
colors=array(((0,0,0,0.1),(0,0,0,0.8)))))
# draw a random texture with alpha channel
X,Y = meshgrid(arange(0,1,0.005),arange(0,1,0.01))
Ic = zeros((X.shape[0],X.shape[1],4))
Ic[:,:,1] = 0.5*sin(20*Y)+0.5
Ic[:,:,2] = 1
Ic[:,:,3] = 0.5*sin(20*Y)+0.5
handles.append(env.drawplane(transform=matrixFromAxisAngle(array((1,0,0)),pi/4),extents=[1.0,0.5],texture=Ic))
# spin one of the plots in another thread
spinner = PlotSpinner(handles[-1])
spinner.start()
Tcamera = eye(4)
Tcamera[0:3,3] = [-0.37, 0.26, 3.3]
env.GetViewer().SetCamera(Tcamera)
raw_input('Enter any key to quit. ')
handles = None
finally:
if spinner is not None:
spinner.ok = False