本文整理汇总了C++中Pose3D::cameraTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Pose3D::cameraTransform方法的具体用法?C++ Pose3D::cameraTransform怎么用?C++ Pose3D::cameraTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pose3D
的用法示例。
在下文中一共展示了Pose3D::cameraTransform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: applyTransform
void Mesh::applyTransform(const Pose3D& pose)
{
foreach_idx(i, vertices)
vertices[i] = pose.cameraTransform(vertices[i]);
ntk::Pose3D normal_pose;
normal_pose.applyTransformBefore(cv::Vec3f(0.f,0.f,0.f), pose.cvEulerRotation());
foreach_idx(i, normals)
normals[i] = normal_pose.cameraTransform(normals[i]);
}
示例2: estimateOptimalPlanes
void MeshRenderer :: estimateOptimalPlanes(const Pose3D& pose, float* near_plane, float* far_plane)
{
float min_z = std::numeric_limits<float>::max();
float max_z = 0.01f;
for (int i = 0; i < m_mesh->faces.size(); ++i)
{
const Point3f& v1 = m_mesh->vertices[m_mesh->faces[i].indices[0]];
const Point3f& v2 = m_mesh->vertices[m_mesh->faces[i].indices[1]];
const Point3f& v3 = m_mesh->vertices[m_mesh->faces[i].indices[2]];
Point3f pv1 = pose.cameraTransform(v1);
Point3f pv2 = pose.cameraTransform(v2);
Point3f pv3 = pose.cameraTransform(v3);
min_z = ntk::math::min(min_z,-pv1.z);
min_z = ntk::math::min(min_z,-pv2.z);
min_z = ntk::math::min(min_z,-pv3.z);
max_z = ntk::math::max(max_z,-pv1.z);
max_z = ntk::math::max(max_z,-pv2.z);
max_z = ntk::math::max(max_z,-pv3.z);
}
ntk_dbg_print(min_z, 2);
ntk_dbg_print(max_z, 2);
if (min_z < 0)
min_z = 0.01f;
if (max_z < min_z)
max_z = (min_z*2);
*near_plane = min_z*0.9f;
*far_plane = max_z*1.1f;
}