Page 1 of 1

Custom Loading

Posted: Tue Jul 20, 2004 4:25 pm
by Yago
Hi!! I have one question. How I can load a custom file format exported from 3DStudio Max in Irrlicht?? I want to add the geometrie from this file to the SceneManager of Irrlicht.

Thanks!

Posted: Tue Jul 20, 2004 11:01 pm
by dingo
If the file format is one that you've created then you are going to need to write your own importer for Irrlicht (if you didn't already know this then it is probably going to be too hard to do so).

The other alternative is open the file in 3DS Max and export it in a format that Irrlicht already supports

Posted: Wed Jul 21, 2004 10:27 am
by Yago
Yes, I look look for create a new exporter, but is a little hard to do :P, I have another choice with SMesh and SMeshBuffer.

I look the SMesh class and the SMeshBuffer class. Whit these objects I can do shomething like "a custom exporter", opening the file and add the vertex, Index vertex, tv,tu,etc... to SMeshBuffer??? I tryng to do this but I don't know if this is good and optim for the renderer.


something like this:

SMesh *Mesh=new SMesh();
SMeshBuffer *MeshBuffer = new SMeshBuffer();


////////////
openning the file
Adding the vertex, index, colors, tu/tv mapping, box etc... to MeshBuffer
///////////

Mesh->MeshBuffers.push_back(MeshBuffer);

m_pNode = m_Smgr->addMeshSceneNode (Mesh, NULL);
///or
m_pNode = m_Smgr->addOctTreeSceneNode(Mesh);

Posted: Wed Jul 21, 2004 10:25 pm
by dingo
I have a feeling this is *possible* but probably will take too much time to get it working for it to cost effective (cost on your time fro result).

Most ppl will just say export from your program to a .x file and then import the .x into Irrlicht.

But by all means you can extend Irrlicht to include a new format - my only suggestion would be write a simple loader in pure c++ first to understand everything required before you add in the extra layer o Irrlicht. www.gametutorials.com has some nice loaders in straight c++ if you want to lik at that code.

BTW *simple* code to load and display a BSP file would normally be approx 2000 - 2500 lines of code.

Posted: Wed Jul 21, 2004 10:35 pm
by l0calh05t
dingo wrote:I have a feeling this is *possible* but probably will take too much time to get it working for it to cost effective (cost on your time fro result).

Most ppl will just say export from your program to a .x file and then import the .x into Irrlicht.

But by all means you can extend Irrlicht to include a new format - my only suggestion would be write a simple loader in pure c++ first to understand everything required before you add in the extra layer o Irrlicht. www.gametutorials.com has some nice loaders in straight c++ if you want to lik at that code.

BTW *simple* code to load and display a BSP file would normally be approx 2000 - 2500 lines of code.
I'm pretty sure you can do it in a lot less than that (at least the loader itself) i added a loader for my own xml-based model format (which will be replaced later on with a binary format and is currently only for static meshes) and the code is around 300 lines long (not counting the xml parser itself of course)

Posted: Thu Jul 22, 2004 12:34 am
by Yago
Now I have a level, from my custom format, rendered in Irrlicht, but I have another question jeje (I want to try this alternative, if this don't work I look for write a new loader).

When I have a new SMesh and add them to the OctreeSceneNode (addOctTreeSceneNode), Irritch create a new Octree System or add it to the current Octree System??


Thanks!!