//! Création de la grille
void CalibrationUtils::setGrid(int x, int y)
{
	//Nombre de points de calibration sur chaque cercle de calibration - 1
	GRID_X = x;
	//Nombre de cercle de calibration - 1
	GRID_Y = y;
	//Nombre de points de calibration
    GRID_POINTS = GRID_X+1;
	for (int i=2; i<= GRID_Y+1; i++) GRID_POINTS += i*GRID_X;
    //printf("\nX : %d\nY : %d\n",x,y);
    //printf("GRID_POINTS : %d\n",GRID_POINTS);

	//Initialisation des listes de points, et des zones de calibration
	screenPoints = new calibrationPoint[GRID_POINTS];
	cameraPoints = new calibrationPoint[GRID_POINTS];
	triangles	 = new std::vector<triangle*>();

	//Si les deux listes de points sont crées
	if(bscreenPoints && bcameraPoints)
	{
		//Initialisation des points à afficher
		initScreenPoints();
		//Initialisation des points à lire
		initCameraPoints(_camWidth, _camHeight);
        //Initialisation des triangles
        initTriangles();
	}
}
Esempio n. 2
0
void CalibrationUtils::setScreenScale(float s)
{
	// legacy
	float offset = (1.0f - s)*0.5f;
	screenBB = rect2df(vector2df(offset,offset),vector2df(1.0f-offset,1.0f-offset));
	initScreenPoints();
}
Esempio n. 3
0
void CalibrationUtils::setGrid(int x, int y)
{
	GRID_Y = y;
	GRID_X = x;

	GRID_POINTS = ((GRID_X+1) * (GRID_Y+1));
    GRID_INDICES = (GRID_X * GRID_Y * 3 * 2);

	screenPoints = new vector2df[GRID_POINTS];
	cameraPoints = new vector2df[GRID_POINTS];
	triangles    = new int[GRID_INDICES];

	initTriangles();

	if(bscreenPoints && bcameraPoints){
	initScreenPoints();
	initCameraPoints(_camWidth, _camHeight);
	}
}
//! Taille de la zone d'affichage
void CalibrationUtils::setScreenBBox(rect2df &box)
{
	screenBB = box;
	initScreenPoints();
}
Esempio n. 5
0
//Bounding Box Size
void calibrationB::setScreenBBox(rect2df &box)
{
	screenBB = box;
	initScreenPoints();
}