#include <iostream>
#include <visp/vpOpenCVGrabber.h>
#include <visp/vpV4l2Grabber.h>
#include <visp/vp1394TwoGrabber.h>
#include <visp/vpDirectShowGrabber.h>
#include <visp/vpHomogeneousMatrix.h>
#include <visp/vpImage.h>
#include <visp/vpCameraParameters.h>
#include <visp/vpAROgre.h>
#if defined(VISP_HAVE_OGRE)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
class vpAROgreAdvanced :
public vpAROgre
{
private:
Ogre::AnimationState * mAnimationState;
public:
unsigned int width = 640, unsigned int height = 480)
{
mAnimationState = NULL;
}
protected:
{
Ogre::Entity* robot = mSceneMgr->createEntity("Robot", "robot.mesh");
Ogre::SceneNode* RobotNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("Robot");
RobotNode->
setPosition((Ogre::Real)-0.3, (Ogre::Real)0.2, (Ogre::Real)0);
RobotNode->attachObject(robot);
RobotNode->scale((Ogre::Real)0.001,(Ogre::Real)0.001,(Ogre::Real)0.001);
RobotNode->pitch(Ogre::Degree(180));
RobotNode->yaw(Ogre::Degree(-90));
mAnimationState = robot->getAnimationState( "Idle" );
mAnimationState->setLoop( true );
mAnimationState->setEnabled( true );
}
{
mAnimationState->addTime( evt.timeSinceLastFrame );
return true;
}
};
#endif
#endif
int main()
{
try {
#if defined(VISP_HAVE_OGRE)
#if defined(VISP_HAVE_V4L2) || defined(VISP_HAVE_DC1394_2) || defined(VISP_HAVE_DIRECTSHOW) || defined(VISP_HAVE_OPENCV)
#if defined(VISP_HAVE_V4L2)
#elif defined(VISP_HAVE_DC1394_2)
#elif defined(VISP_HAVE_DIRECTSHOW)
#elif defined(VISP_HAVE_OPENCV)
#endif
double px = 565;
double py = 565;
cMo[2][3] = 1.;
vpAROgreAdvanced ogre(cam, (
unsigned int)grabber.
getWidth(), (
unsigned int)grabber.
getHeight());
while(ogre.continueRendering()){
ogre.display(I, cMo);
}
#else
std::cout << "You need an available framegrabber to run this example" << std::endl;
#endif
#else
std::cout << "You need Ogre3D to run this example" << std::endl;
#endif
return 0;
}
std::cout << "Catch an exception: " << e << std::endl;
return 1;
}
catch(...) {
std::cout << "Catch an exception " << std::endl;
return 1;
}
}