Looks like something Johnny added on his own. My lib has only ever tracked 2 IR points. I'll look into adding it officially for the next version.
I've modifed the wiimotelib to support 4 ir dots, its just an dirty hack, but it works :)
Although the midx/y and rawmidx/y could be done a little better, if a ir dot becomes ofscreen its sometimes doesn't calculate right.. but someone who can do a little math can easily fix that :)
I just updated the official distribution with IR3/4. I was waiting to release with several other things added, but with all of the confusion and questions, I figured it was best to get it up there ASAP. Head over to CodePlex to get the new version...
hello, can somebody please tell me how to track point 3 and 4 / their middlepoint? thank you!
If you have 3 or 4 IR sources, they will automatically be tracked. There is no automatic midpoint for 3 and 4...just 1 and 2.
thanks for your reply, brian.
wouldn't it be useful, to implement midpoint calculation when using 4 ir sources? you could choose the closest 2 points as one hand / pair.
Strictly my opinion:
I think it gets tricky on how to calculate midpoints with the 4 IRs.
I've never come up with a decent solution beyond trying to do all of them, and then I'm not sure it fits within the scope of the library itself, which is why I left it up to the user to do what they need or want with the points.
I'm open to any and all ideas on the matter and will happily implement what people feel is important. I'm just not sure what that is.
well i think the most useful case would be when you have 2 gloves with each 2 ir sources.
take always the closest two ir sources as one hand / pair and calculate their midpoint. if one ir source drops i would interpret this as a special action e.g. this could simulate a mouse click (bring the 2 ir sources of one glove close together and they will be seen as one point for the wii controller / one source will be dropped). so you could use two gloves with each 2 infrared lights to play a little bit minority report, like it's already done in some videos on the net.
anyways you could be right that this is out of scope for the library or what the library was ntended for, however it doesn't restrict users in what they do (if they don't want to use this function they shall just not use it) and it should be a realisitic usage case. shouldn't be to hard to implemenet this by one's own though, but if it's alreay included... less work ;)
And that's the next problem. :)
Your example is for gloves where the two closest points create the midpoint. That may not work for everyone's needs. I've always seen my library as being a "hey, here's data from the Wiimote...do something with it" kind of setup. I think this gives the maximum flexibility for everyone.
<shrug>