Page 1 of 1

Setting color of object without lighting?

Posted: Tue Apr 24, 2007 2:11 pm
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?

Posted: Tue Apr 24, 2007 3:12 pm
by Robert Y.
Just change the texture for it.

Posted: Tue Apr 24, 2007 3:41 pm
by Vuen
I don't want to do that, because there are three moons, and I want them all to be different colors.

Posted: Tue Apr 24, 2007 5:50 pm
by spopo
Use three textures?

Posted: Tue Apr 24, 2007 6:53 pm
by monkeycracks
That raises the question.. Why isn't the ambience working?

Posted: Wed Apr 25, 2007 7:12 am
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.