Black model

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
psilobe
Posts: 1
Joined: Wed Jan 04, 2012 9:00 pm

Black model

Post by psilobe »

Hi, I'm basicly trying out the first few tutorials with a couple of differences. I'm not using a fix model but creating one out of a bunch of volume data.

First I use this function to create a meshbuffer.

CDynamicMeshBuffer *newBuffer = new CDynamicMeshBuffer(EVT_STANDARD, EIT_32BIT);

Then I have a function which fills this one with stuff and then in my main loop execute the following.

SMesh* mesh;
mesh = new SMesh();
mesh->addMeshBuffer(newBuffer);

IMeshSceneNode* node = smgr->addMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, true);
}

The result is that I see the model but it's completely black, I do have a light source added and I've also tried disabling lightning.
CuteAlien
Admin
Posts: 9846
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Black model

Post by CuteAlien »

Well, I don't see how you create it - do you set any colors?
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
shadowghost21
Posts: 56
Joined: Wed Nov 23, 2011 11:53 pm

Re: Black model

Post by shadowghost21 »

I would also venture a guess is because you have no lights in the scene and you turned on the lighting flag.
CuteAlien
Admin
Posts: 9846
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Black model

Post by CuteAlien »

He mentioned those, that's why I rather guess vertex-colors might be black.
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