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.
-
bruZard
- Posts: 14
- Joined: Thu Mar 19, 2009 9:21 am
Post
by bruZard »
I've created a Plane:
Code: Select all
IMesh* mesh = context->getSceneMgr()->getGeometryCreator()->createPlaneMesh(
dimension2d<f32>(1.0, 1.0),
dimension2du(u32(subDivs), u32(subDivs)),
mat);
IMeshSceneNode* plane = context->getSceneMgr()->addMeshSceneNode(mesh, parent);
plane->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
plane->setMaterialType(EMT_SOLID);
Now i try to change the color of the plane:
Code: Select all
plane->getMaterial(0).DiffuseColor.set(255, 255, 0, 0);
Why will this not work?
-
CuteAlien
- Admin
- Posts: 9734
- Joined: Mon Mar 06, 2006 2:25 pm
- Location: Tübingen, Germany
-
Contact:
Post
by CuteAlien »
Not sure if standard fixed function pipeline can do that - diffuse lighting might need pixel-shaders.
-
bruZard
- Posts: 14
- Joined: Thu Mar 19, 2009 9:21 am
Post
by bruZard »
Why the node had a material if i can't change the color of it?
-
CuteAlien
- Admin
- Posts: 9734
- Joined: Mon Mar 06, 2006 2:25 pm
- Location: Tübingen, Germany
-
Contact:
Post
by CuteAlien »
You can work with the other colors. You can experiment with the different combinations of materials and lights in the example 22.MaterialViewer.