10 #include <mrpt/opengl/CAssimpModel.h>
11 #include <mrpt/opengl/CCylinder.h>
12 #include <mrpt/opengl/CSphere.h>
13 #include <mrpt/system/filesystem.h>
14 #include <mrpt/system/os.h>
23 using namespace mvsim;
28 const float radius = 0.5f;
29 auto glSphere = mrpt::opengl::CSphere::Create(radius);
31 const Shape2p5 shape = csc.get(*glSphere, -radius, +radius, {}, 1.0f);
33 std::cout <<
"Sphere:\n" << shape.
getContour() << std::endl;
40 const float radius = 0.5f, L = 2.0f;
41 auto glCyl = mrpt::opengl::CCylinder::Create(radius, radius, L);
43 const Shape2p5 shape = csc.get(*glCyl, 0, L, {}, 1.0f);
45 std::cout <<
"Cylinder:\n" << shape.
getContour() << std::endl;
52 const float radius = 0.5f, L = 2.0f;
53 auto glCyl = mrpt::opengl::CCylinder::Create(radius, radius, L);
56 csc.get(*glCyl, 0, L, mrpt::poses::CPose3D::FromTranslation(-0.15, 0, 0), 1.0
f);
59 csc.get(*glCyl, 0, L, mrpt::poses::CPose3D::FromTranslation(0.15, 0, 0), 1.0
f);
64 std::cout <<
"Cylinder 1:\n" << s1.
getContour() << std::endl;
65 std::cout <<
"Cylinder 2:\n" << s2.
getContour() << std::endl;
66 std::cout <<
"Cylinder 1+2:\n" <<
s.getContour() << std::endl;
73 auto glModel = mrpt::opengl::CAssimpModel::Create();
74 glModel->loadScene(mrpt::system::pathJoin({MVSIM_TEST_DIR,
"../models/simple_camera.dae"}));
76 const Shape2p5 shape = csc.get(*glModel, 0, 1.0, {}, 1.0f);
78 std::cout <<
"SimpleCamera .DAE:\n" << shape.
getContour() << std::endl;
81 int main([[maybe_unused]]
int argc, [[maybe_unused]]
char** argv)
83 std::vector<std::pair<std::function<
void(
void)>, std::string>> lst = {
92 for (
const auto& kv : lst)
97 printf(
"[%20s] Running...\n", kv.second.c_str());
103 printf(
"[%20s] Success\n", kv.second.c_str());
106 catch (
const std::exception& e)
108 std::cerr << e.what();
110 printf(
"[%20s] FAIL\n", kv.second.c_str());
116 return anyFail ? 1 : 0;