コード例 #1
0
void MyPrimitive::GeneratePlane(float a_fSize, vector3 a_v3Color)
{
	if (a_fSize < 0.01f)
		a_fSize = 0.01f;

	Release();
	Init();

	float fValue = 0.5f * a_fSize;

	vector3 pointA(-fValue, -fValue, 0.0f); //0
	vector3 pointB(fValue, -fValue, 0.0f); //1
	vector3 pointC(fValue, fValue, 0.0f); //2
	vector3 pointD(-fValue, fValue, 0.0f); //3

	vector3 pointE(fValue, -fValue, -0.001f); //1
	vector3 pointF(-fValue, -fValue, -0.001f); //0
	vector3 pointG(fValue, fValue, -0.001f); //2
	vector3 pointH(-fValue, fValue, -0.001f); //3

											  //F
	AddQuad(pointA, pointB, pointD, pointC);
	//Double sided
	AddQuad(pointE, pointF, pointG, pointH);

	CompileObject(a_v3Color);
}
コード例 #2
0
void LeapMapping::mapPoints(Point &point, Point &mappedPoint)
{
    Mat pointH(3,1,CV_32F);
    pointH.at<float>(0)=point.x*numPxperMM_width;
    pointH.at<float>(1)=point.y*numPxperMM_height;
    pointH.at<float>(2)=1;

    Mat mappedPointH=transformationMatrix*pointH;

    mappedPoint = Point(mappedPointH.at<float>(0,0),mappedPointH.at<float>(1,0));
}