Custom Loading

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
Yago

Custom Loading

Post 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!
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post 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
-= Want your C code to control real life robots? www.users.on.net/~symes =-
Yago

Post 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);
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post 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.
-= Want your C code to control real life robots? www.users.on.net/~symes =-
l0calh05t
Posts: 68
Joined: Wed Apr 07, 2004 7:08 pm

Post 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)
Raw data for raw nerves

My main PC: Athlon XP 2800+, 512MB RAM, ATI Radeon 9700 Pro 128MB, Win2k SP4
My secondary PC: Pentium III 500 Mhz, 256MB RAM, TNT2 64, Gentoo Linux
Yago

Post 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!!
Post Reply