setting color in irrlicht
Hi
I need to set the color of a SphereSceneNode in Irrlicht
Nothing fancy, I'm looking for something like item->setColor(r,g,b)
is there an easy way to do that?
thanks
Nicola
There is no easy way to do this in Irrlicht. You can do it this way:
I haven't attempted to compile it.
// Create a new texture and set it so we can draw to it.ITexture * target = driver->createRenderTargetTexture(dimension2d<s32>(128, 128));driver->setRenderTarget(target);// Fill the texture with the color of your choice.SColor yourColor(255, 255, 200, 0); // a r g bdriver->draw2DRectangle(yourColor, rect<s32>(position2d<s32>(0,0),position2d<s32>(128,128)));// Set the render target back to the screen.driver->setRenderTarget(0);ISceneNode * yourSceneNode; // this variable contains your SphereSceneNode// Set the color textureyourSceneNode->setMaterialTexture(0, target);
I haven't attempted to compile it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement