WiiLi Wiki frontpage Include your post in the News Get links Hoteles Quito
WiiLi.org Forum Index WiiLi.org
a new revolution
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New IR mouse track script! For 1 IR source

 
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts
View previous topic :: View next topic  
Author Message
giorgiouniv



Joined: 20 Jan 2007
Posts: 5

Digg It
PostPosted: Mon Jan 29, 2007 7:41 pm    Post subject: New IR mouse track script! For 1 IR source

Hi to everybody!
That's a new script for wii mouse IR track of 1 IR source.
It is quite precise, in my opinion.
Give me suggestions! http://www.myspace.com/giorgiouniv

that's the code:
Code:
// Mouse IR Control Script
// by giorgiouniv
// giorgio_univ@hotmail.it
//
// calibration: as the the var.precision value decreases, the mouse
// movement will be smoother, but slower; as it will increase, it will
// become more faster, but less precise
var.precision=0.05



Mouse.RightButton = Wiimote.A
Mouse.LeftButton = Wiimote.B
Mouse.MiddleButton = Wiimote.Home

Keyboard.Up = Wiimote.Up
Keyboard.Down = Wiimote.Down
Keyboard.Left = Wiimote.Left
Keyboard.Right = Wiimote.Right

if wiimote.plus then
   volumeup = true
   wait 60 ms
   volumeup = false
endif
if wiimote.minus then
   volumedown = true
   wait 60 ms
   volumedown = false
endif


if 0 = 0 then
if var.kitt = 0 then
wiimote.Leds = 1
endif
if var.kitt = 1 then
wiimote.Leds = 3
endif
if var.kitt = 2 then
wiimote.Leds = 6
endif
if var.kitt = 3 then
wiimote.Leds = 12
endif
if var.kitt = 4 then
wiimote.Leds = 8
endif
if var.kitt = 5 then
wiimote.Leds = 12
endif
if var.kitt = 6 then
wiimote.Leds = 6
endif
if var.kitt = 7 then
wiimote.Leds = 3
endif
wait 50 ms
var.kitt = (var.kitt + 1) % 8
endif

if wiimote.dot1vis then
         var.oldX=mouse.x
         var.oldY=mouse.y

         //debug=var.oldX + ' '+ var.oldY

         //old method..
         //var.xxx=(1024-wiimote.dot1x)/1024
         //var.yyy=(wiimote.dot1y)/768

         //this works better
         var.newWiimoteX=wiimote.dot1x-200
         var.xxx=(800-var.newWiimoteX)/800
         var.yyy=(wiimote.dot1y)/700

         var.dx=var.xxx-var.oldX
         var.dy=var.yyy-var.oldY

         //debug=var.dx + ' '+ var.dy

         if IsZero(var.dx) then

         else
              mouse.x= var.oldX+ (var.dx*var.precision)
         endif

         if IsZero(var.dy)  then

         else
              mouse.y= var.oldY+ (var.dy*var.precision)
         endif

         debug='tracking'
else
         debug='not tracking'
endif



What do you think about it?
See this new video about wii mouse use with windows..
http://www.youtube.com/watch?v=PEqACmQCWxg
Thanks ya!
Giorgio
_________________
http://www.myspace.com/giorgiouniv
Back to top
View user's profile Send private message Visit poster's website
davels



Joined: 01 Feb 2007
Posts: 1

Digg It
PostPosted: Thu Feb 01, 2007 11:20 pm    Post subject:

I test it quickly and seems work fine. (need more candles)

Will try to mix it with nunchuck and play at CSS Very Happy

Thx for your job Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    WiiLi.org Forum Index -> Wii Scripts All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group