1 of 2
1
Wii multitouch with glovepie
Posted: 06 April 2008 07:54 PM   [ Ignore ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

for those who are interested, the program glovepie works as a driver for the wiimote,
and you can program it to take blob touches and translate those to mouse and keyboard events easiely

for example

if Wiimote1.dot1vis true
        Mouse
.MapRange(Wiimote1.dot1x0,10230,1)
        
Mouse.MapRange(Wiimote1.dot1y0,7670,1)
        
Mouse.leftButton true
end 
if

simply looks for one ir point using the camera and translates it to cursor movement with the left button down for movement,
if anyone could help me make a algorithm to work with nasa world wind, please post it here.

I plan to use the wii mote for my multi touch, has anyone tried using it with FTIR?, and is there any way to interface with the camera
on the wii mote like a webcam

glove pie: http://carl.kenner.googlepages.com/glovepie_download

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 07 April 2008 04:43 PM   [ Ignore ]   [ # 1 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

here is a very crude script, i defiantly do not think that the zoom or rotate section works properly, nothing is mapped correctly, but it might give you a idea how it might work

if(Wiimote1.dot1vis == true)
        
Wiimote.Led1 true
        Mouse
.MapRange(Wiimote1.dot1x0,10230,1)
        
Mouse.MapRange(Wiimote1.dot1y0,7670,1)
        
Mouse.leftButton true
end 
if
if (
Wiimote1.dot1vis == true and Wiimote1.dot2vis == true)
        
Wiimote.Led1 true
        Wiimote
.Led2 true
        
//for rotate
              
var.angle = (Wiimote1.dot1y Wiimote1.dot2y)/2
        
//for zoom
              
var.part1 Wiimote1.dot2x Wiimote1.dot1x
              
var.partone sqr(var.part1)
              var.
part2 Wiimote1.dot2y Wiimote1.dot1y
              
var.parttwo sqr(var.part2)
              var.
part3 = var.partone + var.parttwo
              
var.final = sqr(var.part3)

        
Mouse.rightButton true
        Mouse
.DirectInputZ = var.final
        
Mouse.MapRange(var.angle0,10230,1)

end if

// for tilt
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and Wiimote1.dot3vis == true)
        
Wiimote.Led1 true
        Wiimote
.Led2 true
        Wiimote
.Led3 true
        Mouse
.rightButton true
        Mouse
.MapRange(Wiimote1.dot3y0,7670,1)

end if

// for stop
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and (Wiimote1.dot3vis == true and Wiimote1.dot4vis == true))
        
Wiimote.Led1 true
        Wiimote
.Led2 true
        Wiimote
.Led3 true
        Wiimote
.Led4 true
        Key
.Space true

end 
if

if(
Wiimote1.dot1vis == false)
                    
Wiimote.Led1 false
                    Wiimote
.Led2 false
                    Wiimote
.Led3 false
                    Wiimote
.Led4 false
                    Key
.Space false
                    Mouse
.rightButton false
                    Mouse
.leftButton false
end 
if

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 08 April 2008 03:57 PM   [ Ignore ]   [ # 2 ]
Sr. Member
Avatar
RankRankRank
Total Posts:  330
Joined  2007-09-18

keep up the good work , i will try that asap

 Signature 

http://sassexperience.org

Profile
 
 
Posted: 08 April 2008 07:07 PM   [ Ignore ]   [ # 3 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

gross the code is bad, i am making a new version using the irmouse script as a base

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 08 April 2008 10:14 PM   [ Ignore ]   [ # 4 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

*UPDATE*

looks like the code is good, just needed to change something with the zoom math, which works great now
I am still having some trouble with the rotate part and that means i am also going to have problems with the tilt stuff (maybe), but it is mostly working
*note* you must disable the bank clock feature in Nasa world widns for this to work, i don’t know why

can anybody tell me how well the wiimote works with FTIR?

//
//
//
//
//                                      TEH LOL
//
//

if(Wiimote1.dot1vis == true)
        
Wiimote.Led1 true
        Mouse
.MapRange(Wiimote1.dot1x0,10230,1)
        
Mouse.MapRange(Wiimote1.dot1y0,7670,1)
        
Mouse.leftButton true
end 
if
if (
Wiimote1.dot1vis == true and Wiimote1.dot2vis == true)
        
Wiimote.Led2 true
        Wiimote
.Led1 true
        
//for rotate
              
var.angle smooth(round((Wiimote1.dot1x Wiimote1.dot2x)/2),10)
                      
Mouse.= var.angle/300
                      mouse
.RightButton true
        
//for zoom

              
var.partone sqr(Wiimote1.dot2x Wiimote1.dot1x)
              var.
parttwo sqr(Wiimote1.dot2y Wiimote1.dot1y)
              var.
part3 = var.partone + var.parttwo
              
var.final = sqrt(var.part3)


        
Mouse.DirectInputZ smooth(var.final*10,4)


end if

// for tilt
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and Wiimote1.dot3vis == true)
        
Wiimote.Led3 true
        Wiimote
.Led2 true
        Wiimote
.Led1 true
        Mouse
.rightButton true
        Mouse
.MapRange(Wiimote1.dot3y0,7670,1)

end if

// for stop
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and (Wiimote1.dot3vis == true and Wiimote1.dot4vis == true))
        
Wiimote.Led4 true
        Wiimote
.Led2 true
        Wiimote
.Led3 true
        Wiimote
.Led1 true
        Key
.Space true

end 
if

if(
Wiimote1.dot1vis == false)
                    
Wiimote.Led1 false
                    Wiimote
.Led2 false
                    Wiimote
.Led3 false
                    Wiimote
.Led4 false
                    Key
.Space false
                    Mouse
.rightButton false
                    Mouse
.leftButton false
end 
if

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 10 April 2008 12:47 AM   [ Ignore ]   [ # 5 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

some updated code, rotate and zoom seam to work great, tilt is still biting my @ss (i think i fixed rotate, opps)

//
//
//
//
//                                      TEH LOL
//
//
PIE.FrameRate 75Hz

if(Wiimote1.dot1vis == true and Wiimote1.dot2vis == false and Wiimote1.dot3vis == false)
        
Wiimote.Led1 true
        
//Mouse.leftButton = true
        //Mouse.x = MapRange(Wiimote1.dot1x, 0,1023, 0,1)
        //Mouse.y = MapRange(Wiimote1.dot1y, 0,767, 0,1)
        
Mouse.Wiimote1.PointerX
        Mouse
.Wiimote1.PointerY

        Mouse
.leftButton true
end 
if
if (
Wiimote1.dot1vis == true and Wiimote1.dot2vis == true and Wiimote1.dot3vis == false)
        
Wiimote.Led2 true
        Wiimote
.Led1 true
        
//for rotate
              
var.angle smooth(round((Wiimote1.dot1y Wiimote1.dot2y +10)/2),10)

        
//for zoom

              
var.partone sqr(Wiimote1.dot2x Wiimote1.dot1x)
              var.
parttwo sqr(Wiimote1.dot2y Wiimote1.dot1y)
              var.
part3 = var.partone + var.parttwo
              
var.final = sqrt(var.part3)

              
Mouse.= var.angle/300
              Mouse
.RightButton true
              Mouse
.DirectInputZ smooth(var.final*10,4)


end if

// for tilt
if (Wiimote1.dot3vis == true and Wiimote1.dot2vis == true and Wiimote1.dot1vis == true)
        
Wiimote.Led3 true
        Wiimote
.Led2 true
        Wiimote
.Led1 true

        
//Mouse.y = Wiimote1.PointerY
        
var.tilt = (Wiimote1.dot3y -60) / -3
        Mouse
.= var.tilt
        Mouse
.rightButton true
end 
if

// for stop
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and (Wiimote1.dot3vis == true and Wiimote1.dot4vis == true))
        
Wiimote.Led4 true
        Wiimote
.Led2 true
        Wiimote
.Led3 true
        Wiimote
.Led1 true
        Key
.Space true
        Key
.Space false

end 
if

if(
Wiimote1.dot1vis == false)
                    
Wiimote.Led1 false
                    Wiimote
.Led2 false
                    Wiimote
.Led3 false
                    Wiimote
.Led4 false
                    Wiimote1
.dot1vis false
                    Wiimote1
.dot2vis false
                    Wiimote1
.dot3vis false
                    Wiimote1
.dot4vis false
                    Key
.Space false
                    Mouse
.rightButton false
                    Mouse
.leftButton false
                    Mouse
.500
                    Mouse
.500
end 
if

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 13 April 2008 02:58 AM   [ Ignore ]   [ # 6 ]
Jr. Member
Avatar
RankRank
Total Posts:  135
Joined  2007-08-19

roftlol
I have a FTIR setup right now and am also working on a DI setup. I would like
to try using the Wiimote but am curious of how you have yours set up? could you
post a pic or vid of your setup ? As soon as i get them up and running I will let
you know how it works for me.

 Signature 

"And crawling on the planets face. Some insects called the human race.
Lost in time, And lost in space and meaning… “

Profile
 
 
Posted: 13 April 2008 09:50 AM   [ Ignore ]   [ # 7 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

i haven’t actually setup my wiimote under my ftir table(it is at school), i have been testing the program using my home pc with a tv remote and a two circuit boards with two led’s on each, so I don’t actually know if it will detect my fingers on the ftir setup because i don’t know if they are bright enough. there is no way to calibrate the ir sensor except on the Wii console so I need somebody to try it out. to get it working donwloadthe glove pie app linked above, pair your wiimote to your pc, copy the code and press run. If you want to test, panning stopping and zooming are the only things working in the most recent version of my code, don’t try to tilt or rotate. ALSO VERY IMPORTANT: delete the mouse.x =500 and mouse.y =500 at the end of the code, other wise you can’t control the mouse manually.

 Signature 

Yaa! Trick Yaa!

Profile
 
 
Posted: 13 April 2008 08:06 PM   [ Ignore ]   [ # 8 ]
Jr. Member
Avatar
RankRank
Total Posts:  139
Joined  2007-09-10

NEW!!!! this is version 2, as opposed to the previous versions, this one can do everything i wanted it to do, except sometimes it messes up, so I only need to eliminate bugs as apposed to adding functionality. Please, I need you guys to test this code out, thanks and post your responses and suggestions here.

//
//
//
//
//                                      TEH LOL    version 2 beta
//
//
PIE.FrameRate 75Hz

if(Wiimote1.dot1vis == true and Wiimote1.dot2vis == false and Wiimote1.dot3vis == false and Wiimote1.dot4vis == false)
        
Wiimote.Led1 true
        
//Mouse.leftButton = true
        //Mouse.x = MapRange(Wiimote1.dot1x, 0,1023, 0,1)
        //Mouse.y = MapRange(Wiimote1.dot1y, 0,767, 0,1)
        
Mouse.Wiimote1.PointerX
        Mouse
.Wiimote1.PointerY

        Mouse
.leftButton true
end 
if
if(
Wiimote1.dot1vis == true and Wiimote1.dot2vis == true and Wiimote1.dot3vis == false and Wiimote1.dot4vis == false)
        
Wiimote.Led2 true
        Wiimote
.Led1 true
        Mouse
.RightButton true
        
var.angle smooth(round((Wiimote1.dot1y Wiimote1.dot2y +20)/2),10)
        var.
partone sqr(Wiimote1.dot2x Wiimote1.dot1x)
        var.
parttwo sqr(Wiimote1.dot2y Wiimote1.dot1y)
        var.
part3 = var.partone + var.parttwo
        
var.final = sqrt(var.part3)
        
//var.final = smooth((sqrt(var.part3))*15,4)

        
var.change += delta(var.final)/21

        
//var.change += delta(smooth(var.angle, 3))

        
if (var.change <= 5.2 and  var.change >= -5.2)
            
Mouse.RightButton true
            Mouse
.+= delta(var.angle/300)*1.5

        
else
            var.
zoom smooth(var.final*11,4)
            
Mouse.DirectInputZ += delta(var.zoom)*1.5
        
endif

end if

// for tilt
if (Wiimote1.dot3vis == true and Wiimote1.dot2vis == true and Wiimote1.dot1vis == true and Wiimote1.dot4vis == false)
        
Wiimote.Led3 true
        Wiimote
.Led2 true
        Wiimote
.Led1 true

        
//Mouse.y = Wiimote1.PointerY

        
var.tilt = -(Wiimote1.dot3y 1.2) / 3
        Mouse
.DirectInputY += Delta(var.tilt)*1.6
        Mouse
.rightButton true

end 
if

// for stop
if ((Wiimote1.dot1vis == true and Wiimote1.dot2vis == true) and (Wiimote1.dot3vis == true and Wiimote1.dot4vis == true))
        
Wiimote.Led4 true
        Wiimote
.Led2 true
        Wiimote
.Led3 true
        Wiimote
.Led1 true
        Key
.Space true
        Key
.Space false

end 
if

if(
Wiimote1.dot1vis == false)
                    
Wiimote.Led1 false
                    Wiimote