Skip to main content
GameDev.net gamedev.net
🔒 Locked

Irrlicht Texturing Problem

Started by Peter Conn Jan 28, 2009 at 2:52 PM 2 replies 1.4k views
Original Post
Peter Conn
Peter Conn
I downloaded irrlicht, (via CodeBlocks DevPak plugin), and loaded the sample program. I changed the model used (from an animMesh to a plain mesh), and the texture, however when I run it, I get my mesh uniformly coloured the colour of the first pixel. The source code that I changed was:

    //IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
    //IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
    IMesh* mesh = smgr->getMesh("Castle.3ds");
    IMeshSceneNode *node = smgr->addMeshSceneNode(mesh);

    if (node)
    {
        node->setMaterialFlag(EMF_LIGHTING, false);
        //node->setFrameLoop(0, 310);
        node->setMaterialTexture( 0, driver->getTexture("RedTexture.png") );
    }

On a side note, I tried to do a similar thing with Blitz3D, and the same thing happened - I could see my mesh, but it was uniformly the colour of the first pixel of the image. I exported the .3ds file from Blender, and I also have tried this with an exported .x file aswell, with the same result (except a different starting orientation of the mesh). I want to have the whole texture spread over the whole mesh. Any help would be much appreciated.
Whether you think you can or think you can’t, you’re probably right – Henry Ford
staticVoid2
staticVoid2
it will probaly be the texture coordinates of the mesh's vertices if you can see the first pixel, does it look ok before you export it?
Sly
Sly
Sounds like your UV coordinates are all zeroes. That would stretch the top-left pixel of the texture across the whole model.
Peter Conn
Peter Conn
Thanks,
I'm using blender, how would I solve this problem? Is there a better way to export the mesh?
Whether you think you can or think you can’t, you’re probably right – Henry Ford

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.