My OBJs are completely white :(

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.
Post Reply
codebox
Posts: 8
Joined: Thu Nov 03, 2005 10:47 am
Location: Karachi, Pakistan
Contact:

My OBJs are completely white :(

Post by codebox »

Hi everyone.. i m a noob..

I am new to Irrlicht but not to programming.

I followed few tutorials and got to learn a few things. Now when i export my Blender models to OBJ format and load them in Irrlicht, i get a completely white object :( no matter if the mesh is UV-mapped or with a plain color shader. this happens with every mesh I take in Irrlicht.

I also loaded my models in MeshViewer application that comes with Irrlicht but got the same result, the mesh was completely white with the terrain in the background.

I am wondering if this is problem with Blender's ability or something. since i searched some threads here, people seem to get Blender to export correctly and perhaps its only me :(

please help. Here is the code of my file:

Code: Select all

#include <irrlicht.h>

using namespace irr;

IrrlichtDevice* device = 0; 

int main()
{  
    device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), 16, false, false, false);
    
    video::IVideoDriver* driver = device->getVideoDriver();
    scene::ISceneManager* smgr = device->getSceneManager();
          
    scene::IAnimatedMeshSceneNode* mynode = smgr->addAnimatedMeshSceneNode(smgr->getMesh("ship.obj"));
    mynode->setPosition(core::vector3df(0,0,10));   
    mynode->setMaterialFlag(video::EMF_LIGHTING, false);
    
    smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
    device->getCursorControl()->setVisible(false); 
    
    while(device->run())
    {
       driver->beginScene(true, true, video::SColor(155,155,155,155));
       smgr->drawAll();
       driver->endScene();
    }

    device->drop();
    return 0;
}
Can any1 tell me what am i missing :)

i can put up the OBJ mesh if required.

Thanks a lot.
Kamran.
you just need an start, the rest is upto your art
dhenton9000
Posts: 395
Joined: Fri Apr 08, 2005 8:46 pm

Post by dhenton9000 »

IAnimatedMesh* gMesh = m_mgr->getMesh("assets\\airpanel_mod.obj");
IAnimatedMeshSceneNode* gNode = m_mgr->addAnimatedMeshSceneNode(gMesh);
gNode->setMaterialFlag(video::EMF_LIGHTING, false);
gNode->setMaterialTexture(0, m_driver->getTexture("assets\\pground2.jpg"));


Obj files do not automattically go find their textures. Some of the other loaders do. such as .X or MD2. That means you have to set the texture yourself.
codebox
Posts: 8
Joined: Thu Nov 03, 2005 10:47 am
Location: Karachi, Pakistan
Contact:

Post by codebox »

thanx a lot dhenton :) that worked! Irr rules..
you just need an start, the rest is upto your art
Post Reply