Page 2 of 3

Posted: Fri May 05, 2006 2:11 pm
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

Posted: Fri May 05, 2006 2:56 pm
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.

Posted: Fri May 05, 2006 3:51 pm
by sudi
It's working i probably just included old headers with the new cpp and lib....thats all

Posted: Sat May 06, 2006 8:07 am
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

Posted: Sat May 06, 2006 3:39 pm
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

Posted: Mon May 08, 2006 4:56 pm
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...

Posted: Wed May 10, 2006 2:12 pm
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

Posted: Wed May 10, 2006 2:38 pm
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.....

Posted: Wed May 10, 2006 3:04 pm
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].

Posted: Wed May 10, 2006 3:11 pm
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...

Posted: Wed May 10, 2006 3:22 pm
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!

Posted: Sat May 13, 2006 9:28 pm
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 :)

Posted: Mon May 15, 2006 12:32 am
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.

Posted: Mon May 15, 2006 2:19 pm
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

Posted: Mon May 15, 2006 3:39 pm
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.