Author Topic: Help: Smoothing for 4 separate IR points  (Read 6284 times)

Offline Dloop

  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
on: March 22, 2010, 02:21:04 AM

My first post here on the forums. Having a school project where we incorporate the Wiimote Whiteboard and been reading up on this site as it has a lot of useful information. But now I need some help and hoping some of you can be of service :)

I am using the library to send points to an interface for our game. The game is mostly a 2 player game but we added support for 4 points so one could incorporate teams of 2 instead in the future. So it is important for us to know the different points.

Now for the game to work well we need some kind of smoothing. This I am not sure how to make in a good way and need your help with. I think I need to be able to search the 2 or 4 last points to see which is closest to the new point to then make a smoothing calculation between the 2 and not between any of the other points.

How would you handle smoothing? And how would the algorithm for smoothing look?

Using C# as the game is made in XNA.

Thank you beforehand for any help with this.

Offline boonjin

  • *
  • Posts: 929
  • Karma: +28/-0
  • Smoothboard Developer
    • View Profile
    • Smoothboard
Reply #1 on: March 22, 2010, 06:52:26 AM

You will just need to keep track on the position of the points and ensure that it is the same tracked point. This will not be difficult as the output for the tracked point should be close to previous states.

For the smoothing part, you can just take the average of past values. For a simple smoothing algorithm, you can take a look at the code I have written with Johnny Lee in Brian Peek's Coding4Fun, Wiimote Whiteboard chapter.

Hope this helps.

Boon Jin

Wii Whiteboard/Wiimote Whiteboard with annotation features and collaborate with multiple iPads and Android Tablets!

Smoothboard for Mac
Using a Mac? Now you can annotate on PowerPoint or Keynote slideshows!


Offline ujs

  • *
  • Posts: 134
  • Karma: +10/-0
    • View Profile
Reply #2 on: March 22, 2010, 11:33:48 AM

How would you handle smoothing? And how would the algorithm for smoothing look?

smoothing isn't really rocket science:

Boon Jin is referring to
If you want to get more fancy, e.g.:

Btw, have you considered using the TUIO data from my app (link in my signature) as input to your game? This would save you the trouble of interacting with the Wiimote at all... just a suggestion.


Java WiimoteWhiteboard for Mac OS X, Windows and Linux.