I have a little problem on iOS, I'm traying to display an image on the background, I followed this link http://www.ogre3d.org/tikiwiki/tiki-ind ... ackgrounds , and I plugged the solution into the template project provided for iOs :
Code: Select all
void DemoApp::setupDemoScene()
{
// Create background material
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("Background", "General");
material->getTechnique(0)->getPass(0)->createTextureUnitState("spheremap.png");
material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
// Create background rectangle covering the whole screen
Ogre::Rectangle2D* rect = new Ogre::Rectangle2D(true);
rect->setCorners(-1.0, 1.0, 1.0, -1.0);
rect->setMaterial("Background");
// Render the background before everything else
rect->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
// Use infinite AAB to always stay visible
Ogre::AxisAlignedBox aabInf;
aabInf.setInfinite();
rect->setBoundingBox(aabInf);
// Attach background to the scene
Ogre::SceneNode* node = OgreFramework::getSingletonPtr()->m_pSceneMgr->getRootSceneNode()->createChildSceneNode("Background");
node->attachObject(rect);
// Example of background scrolling
material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setScrollAnimation(-0.25, 0.0);
// Don't forget to delete the Rectangle2D in the destructor of your application:
delete rect;
// OgreFramework::getSingletonPtr()->m_pSceneMgr->setSkyBox(true, "Examples/SpaceSkyBox");
//
// OgreFramework::getSingletonPtr()->m_pSceneMgr->createLight("Light")->setPosition(75,75,75);
//
// m_pOgreHeadEntity = OgreFramework::getSingletonPtr()->m_pSceneMgr->createEntity("OgreHeadEntity", "ogrehead.mesh");
// m_pOgreHeadNode = OgreFramework::getSingletonPtr()->m_pSceneMgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode");
// m_pOgreHeadNode->attachObject(m_pOgreHeadEntity);
}The texture is loaded correctly, as I can assign it to the ogre head (setMaterail). It's just that the rectangle dont want to appear.
I'm using ogre 1.9 on iOS.
Any idea ?
PS: I'm writing an AR application, the next step is to display the camera stream into the background using dynamic texture, any better idea for doing that ?