本文整理汇总了C++中vec3f::isValid方法的典型用法代码示例。如果您正苦于以下问题:C++ vec3f::isValid方法的具体用法?C++ vec3f::isValid怎么用?C++ vec3f::isValid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vec3f
的用法示例。
在下文中一共展示了vec3f::isValid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void Vizzer::init(ApplicationData &app)
{
assets.init(app.graphics);
vec3f eye(0.5f, 0.2f, 0.5f);
vec3f worldUp(0.0f, 1.0f, 0.0f);
camera = Cameraf(-eye, eye, worldUp, 60.0f, (float)app.window.getWidth() / app.window.getHeight(), 0.01f, 10000.0f);
camera = Cameraf("-0.774448 1.24485 -1.35404 0.999848 1.80444e-009 -0.0174517 0.0152652 -0.484706 0.874544 -0.00845866 -0.874677 -0.484632 0 1 0 60 1.25 0.01 10000");
//-0.774448 1.24485 -1.35404 0.999848 1.80444e-009 -0.0174517 0.0152652 -0.484706 0.874544 -0.00845866 -0.874677 -0.484632 0 1 0 60 1.25 0.01 10000
font.init(app.graphics, "Calibri");
state.bundler.loadSensorFile(constants::dataDir + "/sensors/sample.sensor");
state.bundler.computeKeypoints();
state.bundler.addCorrespondences(1);
state.bundler.addCorrespondences(2);
state.bundler.addCorrespondences(4);
state.bundler.addCorrespondences(6);
state.bundler.addCorrespondences(12);
state.bundler.addCorrespondences(20);
state.bundler.addCorrespondences(30);
state.bundler.addCorrespondences(40);
state.bundler.addCorrespondences(60);
state.bundler.addCorrespondences(80);
state.bundler.addCorrespondences(100);
state.bundler.solve();
state.bundler.thresholdCorrespondences(0.01);
state.bundler.solve();
//state.bundler.thresholdCorrespondences(0.005);
//state.bundler.solve();
state.bundler.saveKeypointCloud(constants::debugDir + "result.ply");
state.bundler.saveResidualDistribution(constants::debugDir + "residuals.csv");
state.frameCloudsSmall.resize(state.bundler.frames.size());
state.frameCloudsBig.resize(state.bundler.frames.size());
for (auto &frame : iterate(state.bundler.frames))
{
vector<TriMeshf> meshesSmall, meshesBig;
auto makeColoredBox = [](const vec3f ¢er, const vec4f &color, float radius) {
TriMeshf result = ml::Shapesf::box(radius, radius, radius);
result.transform(mat4f::translation(center));
result.setColor(color);
return result;
};
const int stride = 5;
for (auto &p : frame.value.depthImage)
{
vec2i coord((int)p.x, (int)p.y);
const vec3f framePos = frame.value.localPos(coord);
if (!framePos.isValid() || p.x % stride != 0 || p.y % stride != 0)
continue;
meshesSmall.push_back(makeColoredBox(frame.value.frameToWorld * framePos, vec4f(frame.value.colorImage(coord)) / 255.0f, 0.002f));
meshesBig.push_back(makeColoredBox(frame.value.frameToWorld * framePos, vec4f(frame.value.colorImage(coord)) / 255.0f, 0.005f));
}
state.frameCloudsSmall[frame.index] = D3D11TriMesh(app.graphics, Shapesf::unifyMeshes(meshesSmall));
state.frameCloudsBig[frame.index] = D3D11TriMesh(app.graphics, Shapesf::unifyMeshes(meshesBig));
}
state.selectedCamera = 0;
}