WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-26-2010, 01:19 AM
shahramy shahramy is offline
Member
 
Join Date: Dec 2009
Posts: 41
Smile mouse pointer

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
Reply With Quote
  #2  
Old 08-31-2010, 12:52 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you post some example code that's shows your problem?
Reply With Quote
  #3  
Old 09-04-2010, 02:27 AM
shahramy shahramy is offline
Member
 
Join Date: Dec 2009
Posts: 41
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.
Reply With Quote
  #4  
Old 09-07-2010, 02:22 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The following code links an object to the mouse position and correctly returns the picked object.
Code:
import viz
viz.go()
	
viz.link( viz.Mouse , viz.addTexQuad(viz.SCREEN,texture=viz.add('crosshair.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)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning mouse() -> Set mouse() of window johannes2 Vizard 1 08-19-2010 02:11 PM
how to remove velocity when mouse is disabled? jvacare1 Vizard 2 02-18-2010 10:25 AM
Navigating an avatar using mouse position(2D) in 3D environment james007 Vizard 1 10-16-2009 11:29 AM
Laser Pointer Question (Again) Elittdogg Vizard 5 09-08-2009 12:02 PM
how to make the mouse pointer pain... yak Vizard 0 05-30-2009 07:05 PM


All times are GMT -7. The time now is 08:19 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC