When iam using AddCubeSceneNode() to draw a Cube,iam getting the cube in black color,how to change its color?? ,i mean i want to apply a bmp file as texture.
I am now using the code below to add texture,but failing to add
node.SetMaterialTexture(0,texWall);
/*where texWall is
texWall = device.VideoDriver.GetTexture(@"..\..\wall.bmp");
*/
Help Needed
Thanks & Reply
Regarding AddCubeSceneNode()
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Add a light to your scene, or setMaterialFlag(video::EMF_LIGHTING, false);
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
I was trying out the simple tutorial and trying to render a cube on the screen with the addcubescenenode function, but there is no cube displayed on the screen. I am using Irrlicht 1.4 version. All i see is a white window, i changed the background to white color as i thot the cube is not visible.
EDIT: Solved, when i added a camera to the scene,
ICameraSceneNode* camera = smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,0,0));
Code: Select all
#include <irrlicht/irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
int main() {
IrrlichtDevice* device = createDevice(EDT_SOFTWARE, core::dimension2d<s32>(640,480));
device->setWindowCaption(L"Irrlicht Engine Demo");
IVideoDriver* video = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
ISceneNode* cube = smgr->addCubeSceneNode(10);
cube->setPosition(vector3df(0,0,5));
cube->setMaterialTexture(0, video->getTexture("sydney.bmp"));
cube->setMaterialFlag(video::EMF_LIGHTING, false);
while(device->run() && device) {
video->beginScene(true, true, video::SColor(255,255,255,255));
smgr->drawAll();
video->endScene();
}
}
ICameraSceneNode* camera = smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,0,0));