49 #include <visp/vpOpenCVGrabber.h>
50 #include <visp/vpV4l2Grabber.h>
51 #include <visp/vp1394TwoGrabber.h>
52 #include <visp/vpDirectShowGrabber.h>
53 #include <visp/vpHomogeneousMatrix.h>
54 #include <visp/vpImage.h>
55 #include <visp/vpCameraParameters.h>
56 #include <visp/vpAROgre.h>
58 #if defined(VISP_HAVE_OGRE)
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62 class vpAROgreAdvanced :
public vpAROgre
66 Ogre::AnimationState * mAnimationState;
70 unsigned int width = 640,
unsigned int height = 480)
73 mAnimationState = NULL;
80 Ogre::Entity* robot = mSceneMgr->createEntity(
"Robot",
"robot.mesh");
82 Ogre::SceneNode* RobotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
"Robot");
83 RobotNode->
setPosition((Ogre::Real)-0.3, (Ogre::Real)0.2, (Ogre::Real)0);
84 RobotNode->attachObject(robot);
85 RobotNode->scale((Ogre::Real)0.001,(Ogre::Real)0.001,(Ogre::Real)0.001);
86 RobotNode->pitch(Ogre::Degree(180));
87 RobotNode->yaw(Ogre::Degree(-90));
91 mAnimationState = robot->getAnimationState(
"Idle" );
93 mAnimationState->setLoop(
true );
95 mAnimationState->setEnabled(
true );
102 mAnimationState->addTime( evt.timeSinceLastFrame );
113 #if defined(VISP_HAVE_OGRE)
114 #if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_DIRECTSHOW) || defined(VISP_HAVE_OPENCV)
117 #if defined(VISP_HAVE_V4L2)
120 #elif defined(VISP_HAVE_DC1394_2)
123 #elif defined(VISP_HAVE_DIRECTSHOW)
126 #elif defined(VISP_HAVE_OPENCV)
152 vpAROgreAdvanced ogre(cam, (
unsigned int)grabber.
getWidth(), (
unsigned int)grabber.
getHeight());
157 while(ogre.continueRendering()){
164 ogre.display(I, cMo);
169 std::cout <<
"You need an available framegrabber to run this example" << std::endl;
172 std::cout <<
"You need Ogre3D to run this example" << std::endl;
177 std::cout <<
"Catch an exception: " << e << std::endl;
181 std::cout <<
"Catch an exception " << std::endl;
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
virtual bool customframeEnded(const Ogre::FrameEvent &evt)
void setPosition(const vpHomogeneousMatrix &cMw)
error that can be emited by ViSP classes.
Implementation of an augmented reality viewer.
unsigned int getWidth() const
Return the number of columns in the image.
Generic class defining intrinsic camera parameters.
Class for the Video4Linux2 video device.
virtual void createScene(void)
void init()
Basic initialisation (identity).
void acquire(vpImage< unsigned char > &I)
Class for firewire ieee1394 video devices using libdc1394-2.x api.
unsigned int getHeight() const
Return the number of rows in the image.
Class for cameras video capture using OpenCV library.