can't load the texture on the animated mesh in ios

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
anirban
Posts: 8
Joined: Mon Jan 27, 2014 4:48 am

can't load the texture on the animated mesh in ios

Post by anirban »

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"));
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: can't load the texture on the animated mesh in ios

Post by Nadro »

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
anirban
Posts: 8
Joined: Mon Jan 27, 2014 4:48 am

Re: can't load the texture on the animated mesh in ios

Post by anirban »

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.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: can't load the texture on the animated mesh in ios

Post by Nadro »

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
anirban
Posts: 8
Joined: Mon Jan 27, 2014 4:48 am

Re: can't load the texture on the animated mesh in ios

Post by anirban »

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.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: can't load the texture on the animated mesh in ios

Post by CuteAlien »

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
anirban
Posts: 8
Joined: Mon Jan 27, 2014 4:48 am

Re: can't load the texture on the animated mesh in ios

Post by anirban »

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?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: can't load the texture on the animated mesh in ios

Post by CuteAlien »

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
mokka
Posts: 2
Joined: Fri Jul 24, 2015 9:35 am

Re: can't load the texture on the animated mesh in ios

Post by mokka »

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.
I have the same problem. How do i "bind the appropriate ones"? :)
Post Reply