wiimote
Hi all,
I'm looking at integrating the wiimote into an environment created in vizard. I've looked at the documentation in help, still relatively new to python and vizard apologies I have a few questions, I was previously using viz.pick to find out which object the mouse is pointing towards. I'm now using a pointer as demonstrated in the documentation: pointer = viz.addTextQuad(viz.SCREEN, texture=viz.add('arrow.tif')) etc.. I need to select an object how would i achieve this without using viz.pick? I have thought about using the arrow keys to navigate similar to the below code using the arrow keys of the keyboard vizact.whilekeydown(viz.KEY_LEFT, viz.rotate, viz.BODY_ORI, -ROTATION_INC, 0, 0) I have got this far :) thinking of creating a seperate method for each button vizact.onsensordown(wiimote,wii.BUTTON_LEFT,func,a rgs) I'm not sure where to go from here. I look forward to hearing your opinions on how to approach this. Thanks |
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(): |
Hi,
I found this code to implement my cursor with wii in my vr and it works great, but just with the first scene cause, i have 4 world each in a scene and i'm trying to implement this on the four scenes but just its working with the first. i searched on the documentation and forums, and i cant find how to tell vizard to generate a line on the second world? for example to check if something colliding between the line but on the scene 2 not in the first one |
Have you tried passing all=True to viz.intersect()?
|
Thanks for your help JimC, but this throws me all the intersections with the line but just in scene 1.
Something that i don't know how to use it because if i print this, is a list with this: [ I don't know why to elements if just intersect with one element(maybe cause it was cube,and intersect with to faces of the cube the line), but how i use this information in hexadecimal? But returning with my original question i found the solution, something that i didn't check before because i was searching the solution on viz.screentoworld but is with |
this is a example of the solution if some want to know, i make it without the wiimote because i didn't have my wiimote at the moment
Code:
import viz |
All times are GMT -7. The time now is 09:15 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC