Hi
There are a lot of question about four point calibration so I created dll to make it as simple as possible.
Usage:
VB .Net
Dim calibration As New four_point_callibration.four_point_calibration
'we must fill in two matrices:
'One of the coordinates of points on the screen. In this case, they are the corners of the screen (1024x768).
Dim corners(,) As Double = {{1, 1}, _
{1024, 1}, _
{1024, 768}, _
{1, 768}}
'Second matrix contains points read from the wiimote. Important! points have to be in the same order as in the first matrix
Dim wii_points(,) As Double = {{x1, y1}, _
{x2, y2}, _
{x3, y3}, _
{x4, y4}}
'Calibration
calibration.do_calibration(wii_points, corners)
'end of calibration
'-------------------------------------------------------------------
'now we can get the coordinates indicated point
Dim x As Double = calibration.get_x(WiimoteState.IRState.IRSensors(0).RawPosition.X, WiimoteState.IRState.IRSensors(0).RawPosition.Y)
Dim y As Double = calibration.get_y(WiimoteState.IRState.IRSensors(0).RawPosition.X, WiimoteState.IRState.IRSensors(0).RawPosition.Y)
'-------------------------------------------------------------------
'to display any matrix in text format you can use:
dim a as string = calibration.MakeDisplayable(corners)
Let me know if it works