 |
WiiLi.org a new revolution
|
| View previous topic :: View next topic |
| Author |
Message |
TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Thu Feb 01, 2007 7:41 pm Post subject: |
|
|
| crono141 wrote: | WOW, I just looked at that script, and man, that is cool. Its absolute movement in a small box in the middle right, with relative movement outside.
That is brilliant. Kudos!
|
heh,t hanx
| Quote: |
I'm guessing we add our own favorite nunchuck controlls to this, right? |
I personally am using ir data with it, but it is your choice
edit: actually I'm using ir data processed like it is on Carl's script, but instead of using the accelerometers when I have the 2 dots visible I use them to get the angle of the wiimote _________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|
| Back to top |
|
 |
petereality
Joined: 05 Jan 2007 Posts: 14
Digg It |
Posted: Thu Feb 01, 2007 10:52 pm Post subject: |
|
|
@ Tiago
Could you post your modified version? I would love to give it a try. |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Fri Feb 02, 2007 12:42 am Post subject: |
|
|
| petereality wrote: | @ Tiago
Could you post your modified version? I would love to give it a try. |
not much a modified version perse, it is just a custom setting combined with extra code (which would llikelly be present on most uses of the script on the wiki)
I changed the X range to be centralized an have the same size as the Y range so the diference in the dimensions of the sensor aray on the camera won't distort the motion when tilting
the following is just the part of the code that was changed, the setup of the variables and the extra code that strightens the dots when the wiimote is rotated
| Code: | //Get de-rotated IR data (detailed comment will be writen if requested)
if (Wiimote1.Dot1Vis and Wiimote1.Dot2Vis)then
var.angle = atan((Wiimote1.dot1y- Wiimote1.dot2y)/(Wiimote1.dot1x- Wiimote1.dot2x))
var.Sin= sin(var.angle)
var.Cos= cos(var.angle)
var.NewX= 511-(var.cos* (511-Wiimote1.Dot1x) - var.Sin* (Wiimote1.Dot1Y- 383))
var.NewY= 383-var.sin* (511-Wiimote1.Dot1x) + var.cos* (Wiimote1.Dot1Y- 383)
var.Iseeit= TRUE
elseif ( Wiimote1.Dot1Vis)
var.angle = Wiimote1.Roll
var.Sin= sin(var.angle)
var.Cos= cos(var.angle)
var.NewX= 511-(var.cos* (511-Wiimote1.Dot1x) - var.Sin* (Wiimote1.Dot1Y- 383))
var.NewY= 383-var.sin* (511-Wiimote1.Dot1x) + var.cos* (Wiimote1.Dot1Y- 383)
var.Iseeit= TRUE
elseif ( Wiimote1.Dot1Vis)
var.angle = Wiimote1.Roll
var.Sin= sin(var.angle)
var.Cos= cos(var.angle)
var.NewX= 511-(var.cos* (511-Wiimote1.Dot2x) - var.Sin* (Wiimote1.Dot2Y- 383))
var.NewY= 383-var.sin* (511-Wiimote1.Dot2x) + var.cos* (Wiimote1.Dot2Y- 383)
var.Iseeit= TRUE
else
var.Iseeit= FALSE
endif
//Setup the input (so you can use any analog input with this code
var.InputX = var.NewX // X component
var.InputXRangeStart = 128 Pixels // Smallest X value possible
var.InputXRangeEnd= 895 Pixels //Biggest X value possible
var.InputXRangeSiz= (var.InputXRangeEnd- var.InputXRangeStart ) //calculates the size of the avaiable range
var.InputY = var.NewY // Y component
var.InputYRangeStart = 0 Pixels // Smallest Y value possible
var.InputYRangeEnd = 767 Pixels //Biggest Y value possible
var.InputYRangeSiz= (var.InputYRangeEnd- var.InputYRangeStart ) //calculates the size of the avaiable range
var.InputEnabled= var.Iseeit//checks to see if the data is avaiable
[quote][/quote] |
_________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|
| Back to top |
|
 |
TiagoTiago
Joined: 20 Jan 2007 Posts: 710 Location: Brasil
Digg It |
Posted: Sat Mar 31, 2007 8:44 pm Post subject: |
|
|
mmm, it woudl be good if someone could use some trig to get the absolute position of the ir dots in relation to the wiimote (or the position fot he wiimoe in relation tot he ir dots) taking in consideration the angle the wiimote is currently at, so if for example one tilted the wiimote up but didn't moved it up nor down the position of the ir dots woudln't be afected by the tiltingg of the wiimote
I don't think I can figure out how to do this yet, perhaps if I had more nfo about 3d trigonometry calculations and stuff...dunno.... _________________ please put the scripts on the wiki so they dont get lost as new stuff is posted!
phpBB doesnt like me,somtimes it will forget to warn me about new replies to threads I asked it to,if you see a thread I should have responded, could please email me? |
|
| Back to top |
|
 |
|
|
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
|