ZEN Tech NZ

AvatarIf there are no technical difficulties rights now, there will be!

Showing posts with label gadgets. Show all posts
Showing posts with label gadgets. Show all posts

Using a Wiimote as an Input Device - Part IV

And after a bit of cut 'n' paste magic we now have a very basic GlovePIE script that we can use to control our avatar in Second Life.



So, in summary we need to follow the following steps for it all to work together.
  1. 'connect' the Wiimote to the PC via Bluetooth
  2. startup GlovePIE
  3. run our script and don't forget to fine tune it
  4. startup SecondLife
  5. and enjoy!
End of Part IV

Using a Wiimote as a PC Input Device - Part IIIB

So now at this point we start cobbling together the scripts we need, again, most of this has been hacked and pasted from other scripts I've seen around.

First we define some of the theshold values:

var.sense0 = 1000
var.thresh0x = 2
var.thresh0y = 1

var.sense = 300
var.threshx = 10
var.threshy = 5

var.sense2 = 100
var.thresh2x = 15
var.thresh2y = 8

var.sense3 = 50
var.thresh3x = 20
var.thresh3y = 12

You can play around with these values later on to fine tune the translation from Wiimote movements to mouse movements.

if var.x > var.thresh0x
mouse.x = mouse.x - 1/var.sense0
endif
if var.x < -var.thresh0x
mouse.x = mouse.x + 1/var.sense0
endif
if var.z > var.thresh0y
mouse.y = mouse.y - 1/var.sense0
endif
if var.z < -var.thresh0y
mouse.y = mouse.y + 1/var.sense0
endif
if var.x > var.threshx
mouse.x = mouse.x - 1/var.sense
endif
if var.x < -var.threshx
mouse.x = mouse.x + 1/var.sense
endif
if var.z > var.threshy
mouse.y = mouse.y - 1/var.sense
endif
if var.z < -var.threshy
mouse.y = mouse.y + 1/var.sense
endif
if var.x > var.thresh2x
mouse.x = mouse.x - 1/var.sense2
endif
if var.x < -var.thresh2x
mouse.x = mouse.x + 1/var.sense2
endif
if var.z > var.thresh2y
mouse.y = mouse.y - 1/var.sense2
endif
if var.z < -var.thresh2y
mouse.y = mouse.y + 1/var.sense2
endif
if var.x > var.thresh3x
mouse.x = mouse.x - 1/var.sense3
endif
if var.x < -var.thresh3x
mouse.x = mouse.x + 1/var.sense3
endif
if var.z > var.thresh3y
mouse.y = mouse.y - 1/var.sense3
endif
if var.z < -var.thresh3y
mouse.y = mouse.y + 1/var.sense3
endif

End Part IIIB

The Solar Tree


I'm not one to get excited about solar powered thingies, but....this one really appeals to me!
This really Photosyntheseeding!