本文整理汇总了C++中eigen::Affine3f::scale方法的典型用法代码示例。如果您正苦于以下问题:C++ Affine3f::scale方法的具体用法?C++ Affine3f::scale怎么用?C++ Affine3f::scale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::Affine3f
的用法示例。
在下文中一共展示了Affine3f::scale方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createSubBox
void createSubBox(Eigen::Affine3f &target, int parent_w, int parent_h, int child_w, int child_h, int off_x, int off_y) {
target = Eigen::Affine3f::Identity();
#define FDIV(a,b) (((float)a)/((float)b))
float rw_scale = FDIV(child_w,parent_w);
float rh_scale = FDIV(child_h,parent_h);
float mw = ((FDIV(1.0,child_w))*((float)off_x));
float mh = (FDIV(1.0,child_h)*((float)off_y));
target.scale(Eigen::Vector3f(rw_scale,rh_scale,0.0f));
target.translate(Eigen::Vector3f(mw,mh,0.0f));
#undef FDIV
}
示例2: paintGL
void GLWidget::paintGL()
{
makeCurrent();
glClearColor(0.7, 0.7, 0.7, 1.0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
if(Interface::showBackgroundImage)
{
// renderTexture.imageAlpha = Interface::alphaBackgroundImage;
// renderTexture.renderTexture(*mTextManagerObj.getBaseTexture(), Eigen::Vector2i(this->width(), this->height()));
}
// phong.render(*mTextManagerObj.getMesh(), *currentCamera, light_trackball);
// multi.render(mTextManagerObj, *currentCamera, light_trackball);
multiMask.useWeights = Interface::useWeights;
multiMask.render(mTextManagerObj, *currentCamera, light_trackball);
// depthMap.render(*mTextManagerObj.getMesh(), calibrationCamera, light_trackball);
if(Interface::camera == Interface::CAMERA_TYPES::FREE)
{
// camera.render();
if(Interface::ShowCameras){
for(int i =0 ; i < mTextManagerObj.getNumPhotos(); i++)
{
mTextManagerObj.changePhotoReferenceTo(i);
camRep.resetModelMatrix();
Eigen::Affine3f m = (*(mTextManagerObj.getViewMatrix())).inverse();
m.translation() -= mTextManagerObj.getMesh()->getCentroid();
m.translation() *= mTextManagerObj.getMesh()->getScale();
m.scale (0.08);
camRep.setModelMatrix(m);
camRep.render(*currentCamera, light_trackball);
}
mTextManagerObj.changePhotoReferenceTo(0);
}
}
}
示例3: normalizeSize
bool normalizeSize(std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &points, std::vector<Eigen::Vector3f, Eigen::aligned_allocator<Eigen::Vector3f> > &normals, Eigen::Affine3f &invTransform)
{
// Assumes normalized rotation/translation
Eigen::AlignedBox3f aabb;
for (size_t i = 0; i < points.size(); ++i) {
aabb.extend(points[i]);
}
// Calculate isotropic scaling to that the longest side becomes unit length
const float s = 1.f / aabb.diagonal().maxCoeff();
for (size_t i = 0; i < points.size(); ++i) {
points[i] *= s;
}
// Assemble inverse transform.
invTransform = Eigen::Affine3f::Identity();
invTransform = invTransform.scale(s);
invTransform = invTransform.inverse();
return true;
}
示例4: cog
template <typename PointInT, typename PointOutT> void
pcl::ESFEstimation<PointInT, PointOutT>::scale_points_unit_sphere (
const pcl::PointCloud<PointInT> &pc, float scalefactor, Eigen::Vector4f& centroid)
{
pcl::compute3DCentroid (pc, centroid);
pcl::demeanPointCloud (pc, centroid, local_cloud_);
float max_distance = 0, d;
pcl::PointXYZ cog (0, 0, 0);
for (size_t i = 0; i < local_cloud_.points.size (); ++i)
{
d = pcl::euclideanDistance(cog,local_cloud_.points[i]);
if (d > max_distance)
max_distance = d;
}
float scale_factor = 1.0f / max_distance * scalefactor;
Eigen::Affine3f matrix = Eigen::Affine3f::Identity();
matrix.scale (scale_factor);
pcl::transformPointCloud (local_cloud_, local_cloud_, matrix);
}
示例5: scale
/**
* @brief Scales the view matrix by given factor in all axis.
* @param scale_factor Scale factors in all axis.
*/
void scale (float scale_factor)
{
view_matrix.scale(scale_factor);
}
示例6: normalizeModelMatrix
/**
* @brief Normalize model matrix to center and scale model.
* The model matrix will include a translation to place model's centroid
* at the origin, and scale the model to fit inside a unit sphere.
*/
void normalizeModelMatrix (void)
{
model_matrix.scale(scale);
model_matrix.translate(-centroid);
}