Setting color of object without lighting?

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
Vuen
Posts: 25
Joined: Tue Jul 11, 2006 8:03 am

Setting color of object without lighting?

Post by Vuen »

Hey guys, I can't seem to change the color of any objects in my scene. I have no lights in my scene, and I set all objects in my scene to not use lighting. I'd like to be able to simply vary the color each object. I've got a moon that I'd like to make red, but it's not working:

Code: Select all

    //add moon
    node = engine->scene->addSphereSceneNode(3.0f, 16, 0, -1, vector3df(0,0,SATELLITE_STARTING_RADIUS + SATELLITE_RADIUS_MULTIPLE));
    node->setMaterialTexture(0, engine->video->getTexture("moon.jpg"));
    node->setMaterialFlag(EMF_LIGHTING, false);
    node->getMaterial(0).AmbientColor = SColor(0,255,0,0);
Here's what happens:

Image

The moon stays the default color, regardless of the AmbientColor of the material. Anyone know how I can turn the moon red?
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

Just change the texture for it.
Vuen
Posts: 25
Joined: Tue Jul 11, 2006 8:03 am

Post by Vuen »

I don't want to do that, because there are three moons, and I want them all to be different colors.
spopo
Posts: 33
Joined: Wed Mar 28, 2007 1:46 pm

Post by spopo »

Use three textures?
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

That raises the question.. Why isn't the ambience working?
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

Why isn't the ambience working?
...a bug?

If lighting is off then set vertex color should work or you can edit texture on run time, pixel by pixel.
Post Reply