WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-27-2009, 09:42 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
try using the viz.screentoworld function to get a line that you can use to call viz.intersect. This code should let you know if the pointer is in line with an object

Code:
def FireLine():
	
	line = viz.screentoworld(pointer.getPosition())
	dir = viz.Vector(line.dir)
	dir.setLength(200)
	begin = line.begin
	end = line.begin + dir
	info = viz.intersect(begin,end)
	if info.valid:
		print "intersected"

vizact.onsensordown(wiimote,wii.BUTTON_B,FireLine)
Reply With Quote
 


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
Strange Wii Mote error... shivanangel Vizard 8 02-18-2009 12:32 PM
vizinfo + wiimote ? djdesmangles Vizard 6 10-22-2008 02:18 PM
Sending sound to Wiimote ? djdesmangles Vizard 1 07-31-2008 11:26 AM
wiimote and sensor bar masaki Vizard 1 03-06-2008 03:07 PM


All times are GMT -7. The time now is 05:17 PM.


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