An8 Importer[Updated 08.Mai 2006: Beta 1.3]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

ok i will do that.....but the slow part in my parser is not the parsing itself....it's the mesh generation in a seperate step......but now u got the source so see for urself...
right now i'm redoing the material part so it supports trans textures, bumpmaps and cubemaps as well....then i will port it to the usual irrlicht structure
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Better fix it first: It's not working. Several errors (no convert() method, no orientation in vector3df,...) but got it finally working.
You should try to use Irrlicht data structures also, or it won't become part of Irrlicht. And support \r (maybe use isspace()) not only \n to support different line ends (I really thought it's completely broken, but it was just the wrong line ending).
Will try my an8 files when I'm at home.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

It's working i probably just included old headers with the new cpp and lib....thats all
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Ok updated everything lightining is now working correctly check first link!

Now i will start with implementing the scene managment maybe i will extend the material list too
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Update again.....now it can load anim8or scenes!!!!! I guess interesting for mapping...

[Edit]
and when i added my scripting commands it will be a strong opponent for the visual editor made by etcaptor cause anim8or has a really friendly userinterface
See first post for download
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Ok now i'm almost done with it....i had my first try on porting it into a Meshloader but it didn't work at all. could someone help me pleaseon this task?

Anyways u can download the new source for the lib and the An8Viewer with the link in my first post....
still havent added the scripting ...it just doesn't work how i want it.....i probably missed something....and the bumpmaps will take some more time too cause i still don't know how to calc the tangents and binormials...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I've uploaded the sources for a moderately condensed version of the importer using no STL constructs, but only Irrlicht types. Also the file interface has changed to IReadFile. No conversion for MeshFileLoader, yet, and before I think I'll optimize the parser. I found the reason for the parser being rather slow: Accessing the last array element all the time instead of using an object and pushing it into the array when done is suboptimal!
The sources are located at http://parsys.informatik.uni-oldenburg. ... Loader.zip
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Thanks Hybrid!
I actually did the same to everything and alredy cramed it into a meshloader class...but just didn'T get the parser to work this saved me a lot of time consuming work.......
Oh and because of the speed...the parser itself isn't really slow....at least i think so...the slow thing is more the meshbuilder part which takes almost forever to add all the faces of a big mesh.....
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

That's also a problem with your loader: You add a new mesh buffer for each face. This is not only time consuming, but also memory wasting and no good style. Better use a mesh buffer per submaterial, i.e. if you have a material list with 3 materials, add 3 mesh buffers and add each face to the mesh buffer with the correct material. You can easily do that when holding an array of mesh buffers which you construct when the material list is loaded. Then load a face and add it to array[materialNumber].
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Yeah but when i than add the meshbuffer with more than 3 vertizes to a mesh and than to a scenenode only one face(the first three points) are drawn.
Oh and by the way i just pluged in ur changed code.....the app crashes u must have changed something which doesn't work...
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to correctly set the indices according to your vertices used. Then this is working like a charme, all other mesh loaders work like that.
For me it's working, so cannot say from here whats wrong. Maybe you have some debug trace? I'm not using windows so I cannot test your apps directly, have to recompile all things. At which point does it crash?

I have updated the loader, now supports files without texture coords and non-triangulated faces. Moreover, the size of the parser has been decreased by 50% by removing lots of redundant code. I've also fixed the normals handling - why did you invert them twice? Texture coordinates are not flipped in my code, I simply cannot belive that texture coordinates would work like that. Can be simply fixed if there are clear evidences against, but the format description does not say anything about coordinate systems!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I finally tested some more an8 files and I'm convinced that the y axis of textures is inverted (for whatever reason...). But I also tested the program under windows now (with dev-cpp) and did not encounter any problems. So I think at least the current sources are giving a stable app :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, some more news from an8 loader. Missing normals are now calculated (face normals) such that something should be visible. for those meshes. I have reduced the parser size further more, restructured lots of information and reduced the memory consumption considerably (hopefully also made everything faster), esp. for non-triangulated faces.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

hybrid u r amazing......can't say anything i didn't have time the last days cause of some school stuff. I know started working on my file format something like the visual editor but not quite....i loads anim8or files and lets u set atributes....then it compiles everything into a binary file...that way u don'T need texture folders and stuff like that...right now i'm working on the lightmap renderer...should be working soon!!!!!

Oh not that u think it's just another visual editor it will allow u to write a cfg file with object types......like doors these settings will be saved along with the rest of the stuff
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

:D It's just that I found anim8tor really useful when prototyping objects such that I really like the idea of loading them directly.
I forgot to mention that the last version requires a simple change to the Irrlicht library (just in quaternion.h, so should run without recompiling Irrlicht): toEuler must be declared 'const' (a good idea anyway). since I use Irrlicht quaternions and want to avoid copying the whole An8File structure I pass around const references which is ok for the loader part, but Irrlicht has still lots of qualifiers missing.
I'll soon post a new version which has the scene loading completely separated from the main parsing routine (put into a separate method) for enhanced readability, speedup and more supported items.
Post Reply