Hi ,
I am trying to display the 2D image in my application .I followed the same in the tutorial .
Ogre::MaterialPtr material =Ogre::MaterialManager::getSingleton().create("Background", "General");
material->getTechnique(0)->getPass(0)->createTextureUnitState("level_1.png");//
material->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
material->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
Ogre::Rectangle2D* rect = new Ogre::Rectangle2D(true);
rect->setCorners(-1.0, 1.0, 1.0, -1.0);
rect->setMaterial("Background");
rect->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND);
Ogre::AxisAlignedBox aabInf;
aabInf.setInfinite();
rect->setBoundingBox(aabInf);
m_pCubeNode = OgreFramework::getSingletonPtr()->m_pSceneMgr->getRootSceneNode()->createChildSceneNode("Background");
m_pCubeNode->attachObject(rect);
material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setScrollAnimation(-0.25, 0.0);
After running the application , it is not displaying anything as a back ground .
But when i add the default images in the media/Materials/textures/spheremap.png , in the code it is displaying the 2d images . But not displaying my own .png files . Please help me
thanks®ards
ananditha
displaying 2d images
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: displaying 2d images
I'd double check your camera/viewport settings. If you put a regular mesh, does it display fine? What if you a default material is used?
-
- Kobold
- Posts: 30
- Joined: Wed Mar 14, 2012 2:25 pm
Re: displaying 2d images
Hi ,
I am getting this error , Please check and help me ...
Error loading texture level11.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource level11.png in resource group General or any other group. in ResourceGroupManager::openResource at /Users/davidrogers/Documents/Ogre/ogre-v1-7/OgreMain/src/OgreResourceGroupManager.cpp (line 753)
I dont have this path . i am new to this .. please help me ..Thanks
I am getting this error , Please check and help me ...
Error loading texture level11.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource level11.png in resource group General or any other group. in ResourceGroupManager::openResource at /Users/davidrogers/Documents/Ogre/ogre-v1-7/OgreMain/src/OgreResourceGroupManager.cpp (line 753)
I dont have this path . i am new to this .. please help me ..Thanks
-
- OGRE Expert User
- Posts: 1920
- Joined: Sun Feb 19, 2012 9:24 pm
- Location: Russia
- x 201
Re: displaying 2d images
Check your resources.cfg file. You have to provide correct paths to your resources there.