Here's another way to do it.
Code:
from viz import *
go()
clearcolor(.8,.8,.8)
vert = add('ball.wrl')
vert.translate(0,1.8,2)
xang = 0
yang = 0
INCREMENT = .5
mouse(OFF)
restrictmouse(OFF)
def mousemove(x,y):
global xang,yang
state = buttonstate()
if state == MOUSEBUTTON_LEFT:
xang = xang + x*INCREMENT
yang = yang + y*INCREMENT
vert.rotate(0,1,0,-x*INCREMENT,RELATIVE_WORLD)
vert.rotate(1,0,0,y*INCREMENT,RELATIVE_WORLD)
mousedata(RELATIVE,RELATIVE)
callback(MOUSEMOVE_EVENT,mousemove)