本文整理汇总了C#中Matrix3x3.GetRow方法的典型用法代码示例。如果您正苦于以下问题:C# Matrix3x3.GetRow方法的具体用法?C# Matrix3x3.GetRow怎么用?C# Matrix3x3.GetRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix3x3
的用法示例。
在下文中一共展示了Matrix3x3.GetRow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Iterate
// Iterate POS algorithm starting from the specified rotation and translation and fine tune it
private float Iterate( Point[] points, ref Matrix3x3 rotation, ref Vector3 translation )
{
float prevError = float.MaxValue;
float error = 0;
// run maximum 100 iterations (seems to be overkill, since typicaly it requires around 1-2 iterations)
for ( int count = 0; count < 100; count++ )
{
Matrix3x3 rotation1, rotation2;
Vector3 translation1, translation2;
// calculates new epsilon values
Vector3 eps = ( modelVectors * rotation.GetRow( 2 ) ) / translation.Z + 1;
// and new pose
POS( points, eps, out rotation1, out rotation2, out translation1, out translation2 );
// calculate error for both new poses
float error1 = GetError( points, rotation1, translation1 );
float error2 = GetError( points, rotation2, translation2 );
// select the pose which gives smaller error
if ( error1 < error2 )
{
rotation = rotation1;
translation = translation1;
error = error1;
}
else
{
rotation = rotation2;
translation = translation2;
error = error2;
}
// stop if error is small enough or started to grow
if ( ( error <= ErrorLimit ) || ( error > prevError ) )
break;
prevError = error;
}
return error;
}