47 #include <visp3/ar/vpAROgre.h> 48 #include <visp3/core/vpCameraParameters.h> 49 #include <visp3/core/vpHomogeneousMatrix.h> 50 #include <visp3/core/vpImage.h> 51 #include <visp3/sensor/vp1394TwoGrabber.h> 52 #include <visp3/sensor/vpOpenCVGrabber.h> 53 #include <visp3/sensor/vpV4l2Grabber.h> 55 #if defined(VISP_HAVE_OGRE) 57 #ifndef DOXYGEN_SHOULD_SKIP_THIS 59 class vpAROgreAdvanced :
public vpAROgre 63 Ogre::AnimationState *mAnimationState;
67 unsigned int height = 480)
70 mAnimationState = NULL;
77 Ogre::Entity *robot = mSceneMgr->createEntity(
"Robot",
"robot.mesh");
79 Ogre::SceneNode *RobotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
"Robot");
82 RobotNode->attachObject(robot);
83 RobotNode->scale((Ogre::Real)0.001, (Ogre::Real)0.001, (Ogre::Real)0.001);
84 RobotNode->pitch(Ogre::Degree(180));
85 RobotNode->yaw(Ogre::Degree(-90));
89 mAnimationState = robot->getAnimationState(
"Idle");
91 mAnimationState->setLoop(
true);
93 mAnimationState->setEnabled(
true);
100 mAnimationState->addTime(evt.timeSinceLastFrame);
111 #if defined(VISP_HAVE_OGRE) 112 #if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) || (VISP_HAVE_OPENCV_VERSION >= 0x020100) 121 #if defined(VISP_HAVE_V4L2) 129 #elif defined(VISP_HAVE_DC1394) 137 #elif defined(VISP_HAVE_OPENCV) 139 cv::VideoCapture grabber(0);
140 if (!grabber.isOpened()) {
141 std::cout <<
"Failed to open the camera" << std::endl;
165 while (ogre.continueRendering()) {
167 #if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394) 169 #elif defined(VISP_HAVE_OPENCV) 177 ogre.display(I, cMo);
180 std::cout <<
"You need an available framegrabber to run this example" << std::endl;
183 std::cout <<
"You need Ogre3D to run this example" << std::endl;
187 std::cout <<
"Catch an exception: " << e << std::endl;
190 std::cout <<
"Catch an exception " << std::endl;
void acquire(vpImage< unsigned char > &I)
void open(vpImage< unsigned char > &I)
unsigned int getWidth() const
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Implementation of an homogeneous matrix and operations on such kind of matrices.
virtual bool customframeEnded(const Ogre::FrameEvent &evt)
error that can be emited by ViSP classes.
Implementation of an augmented reality viewer using Ogre3D 3rd party.
void acquire(vpImage< unsigned char > &I)
void open(vpImage< unsigned char > &I)
vp_deprecated void init()
Generic class defining intrinsic camera parameters.
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
virtual void createScene(void)
unsigned int getHeight() const
Class for firewire ieee1394 video devices using libdc1394-2.x api.