本文整理汇总了C++中Stats::eigenVectors方法的典型用法代码示例。如果您正苦于以下问题:C++ Stats::eigenVectors方法的具体用法?C++ Stats::eigenVectors怎么用?C++ Stats::eigenVectors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stats
的用法示例。
在下文中一共展示了Stats::eigenVectors方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateCovarianceDrawList
void DrawableCovariances::updateCovarianceDrawList() {
GLParameterCovariances *covariancesParameter = dynamic_cast<GLParameterCovariances*>(_parameter);
glNewList(_covarianceDrawList, GL_COMPILE);
if(_covariances &&
covariancesParameter &&
covariancesParameter->show() &&
covariancesParameter->ellipsoidScale() > 0.0f) {
float ellipsoidScale = covariancesParameter->ellipsoidScale();
Eigen::Vector4f colorLowCurvature = covariancesParameter->colorLowCurvature();
Eigen::Vector4f colorHighCurvature = covariancesParameter->colorHighCurvature();
float curvatureThreshold = covariancesParameter->curvatureThreshold();
for(size_t i = 0; i < _covariances->size(); i += covariancesParameter->step()) {
Stats cov = _covariances->at(i);
Eigen::Vector3f lambda = cov.eigenValues();
Eigen::Isometry3f I = Eigen::Isometry3f::Identity();
I.linear() = cov.eigenVectors();
if(cov.n() == 0 )
continue;
I.translation() = Eigen::Vector3f(cov.mean()[0], cov.mean()[1], cov.mean()[2]);
float sx = sqrt(lambda[0]) * ellipsoidScale;
float sy = sqrt(lambda[1]) * ellipsoidScale;
float sz = sqrt(lambda[2]) * ellipsoidScale;
float curvature = cov.curvature();
glPushMatrix();
glMultMatrixf(I.data());
if(curvature > curvatureThreshold) {
glColor4f(colorHighCurvature[0] - curvature, colorHighCurvature[1], colorHighCurvature[2], colorHighCurvature[3]);
sx = ellipsoidScale;
sy = ellipsoidScale;
sz = ellipsoidScale;
}
else {
glColor4f(colorLowCurvature[0], colorLowCurvature[1] - curvature, colorLowCurvature[2], colorLowCurvature[3]);
sx = 1e-03;
sy = ellipsoidScale;
sz = ellipsoidScale;
}
glScalef(sx, sy, sz);
glCallList(_sphereDrawList);
glPopMatrix();
}
}
glEndList();
}