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)
79 Ogre::Entity* robot = mSceneMgr->createEntity(
"Robot",
"robot.mesh");
81 Ogre::SceneNode* RobotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(
"Robot");
83 RobotNode->attachObject(robot);
84 RobotNode->scale(0.001f,0.001f,0.001f);
85 RobotNode->pitch(Ogre::Degree(180));
86 RobotNode->yaw(Ogre::Degree(-90));
90 mAnimationState = robot->getAnimationState(
"Idle" );
92 mAnimationState->setLoop(
true );
94 mAnimationState->setEnabled(
true );
101 mAnimationState->addTime( evt.timeSinceLastFrame );
111 #if defined(VISP_HAVE_OGRE)
112 #if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_DIRECTSHOW) || defined(VISP_HAVE_OPENCV)
115 #if defined(VISP_HAVE_V4L2)
118 #elif defined(VISP_HAVE_DC1394_2)
121 #elif defined(VISP_HAVE_DIRECTSHOW)
124 #elif defined(VISP_HAVE_OPENCV)
148 vpAROgreAdvanced ogre(cam, (
unsigned int)grabber.
getWidth(), (
unsigned int)grabber.
getHeight());
153 while(ogre.continueRendering()){
160 ogre.display(I, cMo);
165 std::cout <<
"You need an available framegrabber to run this example" << std::endl;
168 std::cout <<
"You Ogre3D to run this example" << 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)
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.