Hello!
I would like to know how i can reflect the environment of a rectangle for example. So that it looks like metal. I think there is such an effect in Irrlicht (SphereMap) but i don't know how to use it. Can somebody please help me?!
Thanks for advance!
Metal effect?
Last edited by disanti on Tue Feb 22, 2011 8:04 am, edited 1 time in total.
-
- Posts: 16
- Joined: Mon Jan 12, 2004 4:31 am
- Location: USA
- Contact:
It's probably a little bit late now, but if you're still curious on how to do this, here's some sample code:
Just replace "modelFile" with the filename of the mesh you're loading, then replace "modelTexture0" and "modelTexture1" with your two texture maps, and your mesh should have a normal skin, and a reflection map. Hope this helps you out!
Code: Select all
IAnimatedMesh* mesh = smgr->getMesh("modelFile");
IAnimatedMeshSceneNode* anode = 0;
anode = smgr->addAnimatedMeshSceneNode(mesh);
anode->setPosition(vector3df(0, 0, 0));
anode->setMaterialTexture(0, driver->getTexture("modelTexture0"));
anode->setMaterialTexture(1, driver->getTexture("modelTexture1"));
anode->setMaterialType(EMT_REFLECTION_2_LAYER);
anode->addShadowVolumeSceneNode();
smgr->setShadowColor(SColor(50,0,0,0));