PDA

View Full Version : mouse pointer


shahramy
08-26-2010, 01:19 AM
hi
I changed mouse pointer as duckcourt example. I need to use viz.pick but I can not. is there way to solve this problem?
thank you all

Jeff
08-31-2010, 12:52 PM
Can you post some example code that's shows your problem?

shahramy
09-04-2010, 02:27 AM
I meant I want to change cursor shape. if I link a object to mouse pointer, when I use viz.pick, that object has been returned.

Jeff
09-07-2010, 02:22 PM
The following code links an object to the mouse position and correctly returns the picked object.
import viz
viz.go()

viz.link( viz.Mouse , viz.addTexQuad(viz.SCREEN,texture=viz.add('crossha ir.png')) )
viz.mouse(viz.OFF)
viz.mouse.setVisible(viz.OFF)

court = viz.add('court.ive')

male = viz.add('vcc_male.cfg',pos=[-1,0,5],euler=[180,0,0])
male.state(1)

female = viz.add('vcc_female.cfg',pos=[1,0,5],euler=[180,0,0])
female.state(1)

def getPicked():
object = viz.pick()
if object == male:
print 'male'
elif object == female:
print 'female'
elif object == court:
print 'court'

vizact.onmousedown(viz.MOUSEBUTTON_LEFT,getPicked)