Page 1 of 2

3D max to irrlicht?

Posted: Sun Nov 02, 2008 12:11 pm
by Atz666
I have a level in 3d max. I'd like to export it to irrlicht somehow to be able to walk around in it. BSP's seams not to be the answer since If I'd use them I'd have to remake everything in GTkRadiant or so. Is it possible to export to b3d (or something that saves mapping) and add it to a irrlicht scene as a octtree?
I really don't want to remodel the whole thing since it's quite big.

Thanks.

Posted: Sun Nov 02, 2008 1:06 pm
by Dronchik
Hi Atz666. In past, I had this problem.

For map, you must export your map to x, b3d, or obj format and load your map as octtree. If you will need code, about load map as octtree, I'll sended it.

Posted: Sun Nov 02, 2008 2:28 pm
by Atz666
I figuread that about short time ago. The octtree past doesn't seam hard. B3d doesn't know of normal maps, and neither does obj. Does x sport that?. I'd like to use normal maps on most of the walls/floors.

Posted: Sun Nov 02, 2008 3:10 pm
by hybrid
You can use normal maps with all kinds of meshes manually. Irrlicht 1.5 will feature automatic load support for normal maps in .obj and .3ds files.

Posted: Sun Nov 02, 2008 3:41 pm
by jontan6
hybrid wrote:You can use normal maps with all kinds of meshes manually. Irrlicht 1.5 will feature automatic load support for normal maps in .obj and .3ds files.
yey!

Posted: Mon Nov 03, 2008 4:11 am
by Gideon
Am... How load the *.3ds level in Irrlicht? With texture... I do this 3 days yet... please, hepl... :cry:
P.S. I shall happy if anybody write the code of load *.3ds map with a texture=)
P.P.S. Sorry, I'am Russian and have more problem with English... :oops:

Posted: Mon Nov 03, 2008 8:00 am
by Dronchik
Hi Gideon :) Знакомые лица :D When you exporting your map to 3ds, 3D Max have function "export material library" in eporter to 3ds. If you checked that function, you map will export with textures. And with your map going to create file *map's name*.mtl. This file must be in folder next to your map.

Posted: Mon Nov 03, 2008 8:34 am
by skumar
Get b3d pipeline from

www.onigirl.com

it worked for me for exporting lightmaps and static models....

Posted: Mon Nov 03, 2008 10:04 am
by hybrid
3ds files should always load textures which are linked from the 3ds files automatically, unless the texture name is not written into the 3ds file. However, in many cases the filename or path to file are wrong, which would create warning messages on the console!

Posted: Mon Nov 03, 2008 12:36 pm
by Gideon
Thank's. I was download the gile[s] and didэр have problem now. This programm save world in *.b3d, *.x and *.obj format. But... When I load my level I see the bad picture...
Look:
Image
What is it?

P.S. Code:

Code: Select all

#include <irrlicht.h>
#include <iostream>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")

int main()
{
        IrrlichtDevice *device =
                createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480));

        if (device == 0)
                return 1; 
        video::IVideoDriver* driver = device->getVideoDriver();
        scene::ISceneManager* smgr = device->getSceneManager();
        device->getFileSystem()->addZipFileArchive("../../media/mapppeZ!.zip");
        scene::IAnimatedMesh* mesh = smgr->getMesh("ee.b3d");
        scene::ISceneNode* node = 0;
        
        if (mesh)
                node = smgr->addOctTreeSceneNode(mesh->getMesh(0), 0, -1, 128);
        if (node)
                node->setPosition(core::vector3df(-1300,-144,-1249));
        smgr->addCameraSceneNodeFPS();
        device->getCursorControl()->setVisible(false);
        int lastFPS = -1;

        while(device->run())
        {
                if (device->isWindowActive())
                {
                        driver->beginScene(true, true, video::SColor(255,200,200,200));
                        smgr->drawAll();
                        driver->endScene();

                        int fps = driver->getFPS();

                        if (lastFPS != fps)
                        {
                                core::stringw str = L"gently caress!!!!!!!!!";
                                str += driver->getName();
                                str += " | FPS:";
                                str += fps;

                                device->setWindowCaption(str.c_str());
                                lastFPS = fps;
                        }
                }
                else
                        device->yield();
        }
        device->drop();
        return 0;
}

Posted: Mon Nov 03, 2008 12:53 pm
by hybrid
Read the console output: You're rendering more than 65535 vertices per Meshbuffer. This can be easily fixed by defining different materials or mesh groups. Each one is allowed to hold 2^16 vertices.

Posted: Mon Nov 03, 2008 1:11 pm
by Gideon
How I can start in the center of my mesh?

Posted: Mon Nov 03, 2008 6:00 pm
by Atz666
I solved most of the problems... just one left. I'm using b3d pipeline.
How can I just set a color to a mesh from the map?
How can I apply a glass material to a mesh from the map?
Irrlicht doesn't seem to read the alpha value from the b3d material.

Posted: Mon Nov 03, 2008 7:30 pm
by skumar
hi,
You can set alpha of a material in b3d by applying a small bitmap of desired and and setting alpha blend in material editor...i think alpha settings will take effect only if lighting is enabled...just try it...

Posted: Tue Nov 04, 2008 2:24 pm
by Dronchik
Hi gyes. Gideon, if you don't need use normalmapping in 3d max for you map in game, you can use it: http://www.onigirl.com/pipeline/ , else you can use it: http://www.andytather.co.uk/Panda/direc ... loads.aspx