![]() |
|
|
|
#1
|
|||
|
|||
|
Here is some code that uses the arrow keys on the wiimote to change the position of an object:
Code:
MOVE_SPEED = 5 # meters/sec def WiiMove(): elapsed = viz.elapsed() state = wiimote.state if state & wii.BUTTON_LEFT: caveorigin.setPosition([-MOVE_SPEED*elapsed,0,0],viz.REL_LOCAL) if state & wii.BUTTON_RIGHT: caveorigin.setPosition([MOVE_SPEED*elapsed,0,0],viz.REL_LOCAL) if state & wii.BUTTON_UP: caveorigin.setPosition([0,0,MOVE_SPEED*elapsed],viz.REL_LOCAL) if state & wii.BUTTON_DOWN: caveorigin.setPosition([0,0,-MOVE_SPEED*elapsed],viz.REL_LOCAL) vizact.ontimer(0, WiiMove) |
|
#2
|
|||
|
|||
|
Thank you.
In your code you use a timer. Is it not better to react on event? I think the timer checks every often unneccesary. Or is that not possible. I test the code next week. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| orthographic projection in a head-tracked cave environment | michaelrepucci | Vizard | 5 | 12-14-2011 11:29 AM |
| Four Wall Cave on One Computer | envisC | Vizard | 1 | 04-28-2009 06:02 PM |
| Four-wall CAVE using two PCs | dtidrow | Vizard | 5 | 03-24-2009 03:51 PM |
| Sending sound to Wiimote ? | djdesmangles | Vizard | 1 | 07-31-2008 12:26 PM |
| wiimote and sensor bar | masaki | Vizard | 1 | 03-06-2008 04:07 PM |