Problem ! Texture

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
ralo
Posts: 10
Joined: Sat Jan 27, 2007 1:06 pm

Problem ! Texture

Post by ralo »

Hello All,

I am having a problem, I am working on C#.net

1 - When I add a mesh its texture is not loaded, when I set LIGHTING off its grey and I set if on its Black :( . Probably some flags needs to set I guess. Code:
IrrlichtDevice device = new IrrlichtDevice(DriverType.DIRECT3D9);
Irrlicht.Scene.IAnimatedMesh mesh = device.SceneManager.GetMesh(@"..\..\media\plaza.3DS");
ISceneNode node = device.SceneManager.AddAnimatedMeshSceneNode(mesh,null,-1);
node.SetMaterialFlag(MaterialFlag.LIGHTING, false);

2 - Secondly how can i apply multiple textures on one mesh?

Thanks,
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I set LIGHTING off its grey and I set if on its Black
If you enable lighting but don't add a light source, then the node will appear all black. This is what happens when you put yourself in an environment with no lights. If you disable lighting, the model will be displayed using the colors of the model. No lighting calculations will be done. If the model is solid white, then you will see a solid white figure.
Secondly how can i apply multiple textures on one mesh?
Every mesh of the model has mesh buffers, You would need to set the texture for each of those mesh buffers..

Travis
ralo
Posts: 10
Joined: Sat Jan 27, 2007 1:06 pm

Post by ralo »

Thanks for replying

but i am still having the same problem:
Texture is not applied - I added following line

device.SceneManager.AddLightSceneNode(null,new Irrlicht.Core.Vector3D(5,5,5),new Irrlicht.Video.Colorf(1.0f, 1.0f, 1.0f),600.0f,0);

waiting...........
ralo
Posts: 10
Joined: Sat Jan 27, 2007 1:06 pm

Post by ralo »

One more thing, when I apply any texture file its displayed porperly,
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

you dont have to type "new" ...it is even wrong since you need to use "delete" then somewhere ...of course you cant since you dont have pointer to your new object.

use something like:

Code: Select all

scene::ILightSceneNode* light = smgr->addLightSceneNode(0, core::vector3df(-100,100,-100), video::SColorf(255, 255, 255, 255), 1000.0f);
ralo
Posts: 10
Joined: Sat Jan 27, 2007 1:06 pm

Post by ralo »

One thing guys, all other formats are displayed OK like, x, md2 etc. i am having problem with 3ds.
Post Reply