Hi guys,

I am new to wiimote and i would like to write an application like Johnny Whiteboard. I am looking at his source code BUT i am stuck at the UpdateTrackingUtilization() function. I have some questions about the code below:

float UpdateTrackingUtilization()

{

//area of ideal calibration coordinates (to match the screen)

float idealArea = (1 - 2*calibrationMargin) * 1024 * (1 - 2*calibrationMargin) * 768;

//area of quadrliatera

float actualArea = 0.5f * Math.Abs((srcX[1] - srcX[2]) * (srcY[0] - srcY[3]) - (srcX[0] - srcX[3]) * (srcY[1] - srcY[2]));

float util = (actualArea / idealArea)*100;

BeginInvoke((MethodInvoker)delegate() { lblTrackingUtil.Text = util.ToString("f0"); });

BeginInvoke((MethodInvoker)delegate() { pbTrackingUtil.Value = (int)util; });

return util;

}

Where did you get the formula for idealArea, actualArea and util??? Why do we need these variables? and What is BeginInvoke?

Thank you very much and sorry for these noob's questions.

I am new to wiimote and i would like to write an application like Johnny Whiteboard. I am looking at his source code BUT i am stuck at the UpdateTrackingUtilization() function. I have some questions about the code below:

float UpdateTrackingUtilization()

{

//area of ideal calibration coordinates (to match the screen)

float idealArea = (1 - 2*calibrationMargin) * 1024 * (1 - 2*calibrationMargin) * 768;

//area of quadrliatera

float actualArea = 0.5f * Math.Abs((srcX[1] - srcX[2]) * (srcY[0] - srcY[3]) - (srcX[0] - srcX[3]) * (srcY[1] - srcY[2]));

float util = (actualArea / idealArea)*100;

BeginInvoke((MethodInvoker)delegate() { lblTrackingUtil.Text = util.ToString("f0"); });

BeginInvoke((MethodInvoker)delegate() { pbTrackingUtil.Value = (int)util; });

return util;

}

Where did you get the formula for idealArea, actualArea and util??? Why do we need these variables? and What is BeginInvoke?

Thank you very much and sorry for these noob's questions.