b3d mesh texture not working...

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
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

b3d mesh texture not working...

Post by Pythy Python »

I exported my model using blender(blender render) and ran my program...obviously it wasn't textured so my model was white.

So I added the texture code and it still doesn't work...perhaps it is now brown coloured...

here's my code

Code: Select all

 
    scene::IMesh *boxMesh = smgr->getMesh("resource/wall.b3d");
    scene::IMeshSceneNode *box = smgr->addMeshSceneNode(boxMesh);
    
    smgr->addCameraSceneNode(0, core::vector3df(0, -5, 0), core::vector3df(0, 0, 0), -1, true);
    
    if(box){
        box->setMaterialFlag(video::EMF_LIGHTING, false);
        box->setMaterialTexture(0, driver->getTexture("resource/texwall.jpg"));
        box->setPosition(core::vector3df(0, 0, 0));
    }
 

What's my problem?
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: b3d mesh texture not working...

Post by mongoose7 »

Is the MaterialType EMT_SOLID?
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: b3d mesh texture not working...

Post by Pythy Python »

I did that but it still doesn't work.

Code: Select all

box->setMaterialType(video::EMT_SOLID);
I'm predicting that this is probably related to blender because I used to learn Panda3D and I had a similar problem. The solution was to change few options in blender.

So is there's some stuffs that I have to tweak in blender in order to show my texture?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: b3d mesh texture not working...

Post by hendu »

Perhaps the box has no UVs?
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: b3d mesh texture not working...

Post by Pythy Python »

You mean mesh/UV/unwrap? perhaps I did.


This is what I get when I run my game...(image link)

https://www.dropbox.com/s/n3b1pis0cfr20 ... d.png?dl=0
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: b3d mesh texture not working...

Post by CuteAlien »

Are you getting any errors on the console? Also which Irrlicht version are you using? Because texture-loading has changed since 1.8 - so could be svn trunk version (development for the next Irrlicht, but usually in a stable state) works better for that (it checks a few more paths).
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
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: b3d mesh texture not working...

Post by Pythy Python »

No errors in console. I'm running irrlicht 1.8.1

my model format is b3d, texture format is jpg...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: b3d mesh texture not working...

Post by CuteAlien »

OK, then we need the model for testing.
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
Post Reply