I am trying to develop an augmented reality application in ios using vuforia and irrlicht. I am able to place a 3D animated object on an image target,but I am not able to load the texture of the model. The model appears white when i run the app. Can anyone plz help me with this? I am pasting my code snippet where i loaded the mesh and the texture below.
Code Snippet
device = createDevice(video::EDT_OGLES1,dimension2d<u32>([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height),16,true,true,false,0);
driver = device->getVideoDriver();
smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
mesh = smgr->getMesh("sydney.md2");
mNode=smgr->addAnimatedMeshSceneNode(mesh, 0, 1 | 2);
mNode->setMD2Animation(irr::scene::EMAT_STAND);
mNode->setMaterialTexture(0, mDriver->getTexture("sydney.bmp"));
can't load the texture on the animated mesh in ios
Re: can't load the texture on the animated mesh in ios
Are you sure that texture is POT?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: can't load the texture on the animated mesh in ios
Hey Nadro,
Previously I was using OGLES1. Now, I am using OGLES2 and Vuforia along with it. The 1st time when drawall() is called, the texture appears. From 2nd time onwards, the texture disappears and the model appears black on the screen.
And yes, the textures are Power of Two.
Previously I was using OGLES1. Now, I am using OGLES2 and Vuforia along with it. The 1st time when drawall() is called, the texture appears. From 2nd time onwards, the texture disappears and the model appears black on the screen.
And yes, the textures are Power of Two.
Re: can't load the texture on the animated mesh in ios
Maybe Vuforia change some OpenGL states?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: can't load the texture on the animated mesh in ios
Hey Nadro,
Thanks for your help. Yes, the Vuforia changes the active program and active textures. So, I had to again bind the appropriate ones. I again need your help. Is there any way of loading POD files in irrlicht? Till now, I have only loaded md2 and obj models.
Thanks for your help. Yes, the Vuforia changes the active program and active textures. So, I had to again bind the appropriate ones. I again need your help. Is there any way of loading POD files in irrlicht? Till now, I have only loaded md2 and obj models.
Re: can't load the texture on the animated mesh in ios
We have no POD loader so far. We have: b3d, bsp, collada (dae), csm, dmf, lmts, lwo, md2, md3, my3d, obj, oct, ogre, ply, smf, x, stl and .irr loaders. There's a few more loaders out there from others, but haven't seen a pod loader yet - so you would have to code that yourself.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: can't load the texture on the animated mesh in ios
hey cutealien,
thanks for ur reply. Actually i want to render a complete scene consisting of multiple nodes interacting with each other.can u please suggest me a feasible way of doing it?
thanks for ur reply. Actually i want to render a complete scene consisting of multiple nodes interacting with each other.can u please suggest me a feasible way of doing it?
Re: can't load the texture on the animated mesh in ios
Some people use irrEdit to create scenes. Some might use Collada. Personally I tend to use a custom xml file and sometimes a custom (rather game-specific) editor I wrote myself. There's are more solutions (several editors have been in development in the forum), but it always depends on your game which way works best. I think for shooters for example there are some bsp editors which can probably also be used (never did a shooter myself with Irrlicht, so not much experience there).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: can't load the texture on the animated mesh in ios
I have the same problem. How do i "bind the appropriate ones"?anirban wrote:Hey Nadro,
Thanks for your help. Yes, the Vuforia changes the active program and active textures. So, I had to again bind the appropriate ones.