本文整理汇总了C++中ModelFile::RotateAroundCenter方法的典型用法代码示例。如果您正苦于以下问题:C++ ModelFile::RotateAroundCenter方法的具体用法?C++ ModelFile::RotateAroundCenter怎么用?C++ ModelFile::RotateAroundCenter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModelFile
的用法示例。
在下文中一共展示了ModelFile::RotateAroundCenter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestRotation
void TestRotation(const ModelFile &World, const ModelFile &OriginalModel, const LidarScanner &Scanner, const char Which)
{
stringstream ProbFileStream;
ProbFileStream << "ProbR" << Which << ".txt";
string ProbFile = ProbFileStream.str();
ofstream fout(ProbFile.c_str());
int counter = 0;
//double step = PI/20.0;
//for(double angle = -PI; angle <= PI; angle += PI/20.0)
for(double angle = -PI/4.0; angle <= PI/4.0; angle += PI/100.0)
{
cout << "angle = " << angle << endl;
ModelFile Model = OriginalModel;
cout << "Center of mass: " << Model.getCenterOfMass() << endl;
vnl_double_3x3 R = MakeRotation(Which, angle);
Model.RotateAroundCenter(R);
//Transformation Trans(R);
//Model.Transform(Trans);
stringstream ModelFilename;
ModelFilename << "R" << Which << Tools::ZeroPad(counter, 3) << ".vtp";
Model.Write(ModelFilename.str());
//create the comparable models
ComparableModels Comparable(World, Model, Scanner);
double P = CalculateProbability(Comparable, .1);
stringstream ModelPointsFilename;
stringstream WorldPointsFilename;
ModelPointsFilename << "ModelPointsR" << Which << Tools::ZeroPad(counter, 3) << ".vtp";
WorldPointsFilename << "WorldPointsR" << Which << Tools::ZeroPad(counter, 3) << ".vtp";
Comparable.Model.Write(ModelPointsFilename.str());
Comparable.World.Write(WorldPointsFilename.str());
fout << angle << " " << P << endl;
counter++;
}
fout.close();
}