2 #include <visp3/core/vpConfig.h>
3 #ifdef VISP_HAVE_MODULE_AR
4 #include <visp3/ar/vpAROgre.h>
6 #include <visp3/robot/vpSimulatorCamera.h>
7 #include <visp3/visual_features/vpFeatureBuilder.h>
8 #include <visp3/vs/vpServo.h>
23 #if defined(VISP_HAVE_OGRE)
28 vpCameraParameters cam(840, 840, background.getWidth() / 2, background.getHeight() / 2);
35 ogre.setCameraParameters(cam);
36 ogre.addResource(
"./");
37 ogre.init(background,
false,
true);
41 std::vector<std::string> name(4);
42 for (
unsigned int i = 0; i < 4; i++) {
46 ogre.load(name[i],
"Sphere.mesh");
47 ogre.setScale(name[i], 0.02f, 0.02f,
50 ogre.setPosition(name[i],
vpTranslationVector(point[i].get_oX(), point[i].get_oY(), point[i].get_oZ()));
54 Ogre::Light *light = ogre.getSceneManager()->createLight();
55 light->setDiffuseColour(1, 1, 1);
56 light->setSpecularColour(1, 1, 1);
57 light->setPosition((Ogre::Real)cdMo[0][3], (Ogre::Real)cdMo[1][3], (Ogre::Real)(-cdMo[2][3]));
58 light->setType(Ogre::Light::LT_POINT);
67 for (
int i = 0; i < 4; i++) {
81 for (
unsigned int iter = 0; iter < 150; iter++) {
84 for (
int i = 0; i < 4; i++) {
88 #if defined(VISP_HAVE_OGRE)
90 ogre.display(background, cMo);
98 std::cout <<
"Catch an exception: " << e << std::endl;
100 std::cout <<
"Catch an exception " << std::endl;