Gile[s] loader

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Gile[s] loader

Post by sudi »

Since gile[s] is now free i thought integrating a file loader would be cool....so i did.

This loader only loads the mesh and lightmap information. the lights and pivots are not loaded. The reason for the light should be obvious bc its a mesh loader. The pivots are not loaded bc i couldn't figure what they are used for.

the loader is not completly done bc i wasn't able to link all material options to a irrlicht option yet.


Here is picture of the sample scene in irrlicht:
Image

PS: and i guess that i'm doing something wrong with the rotation stuff bc when loading the parkingLot scene three walls are rotatet and placed wrong but everything else is fine really weird.

EDIT: solved the problem

Types, Header, Source

Download with sample scenes and application
(there are hidden gimmics 8) )
Last edited by sudi on Mon Jan 19, 2009 9:48 pm, edited 5 times in total.
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.
fmx

Post by fmx »

that looks amazing, great stuff with the loader!

Pivots are important, because they determine how (and where) the vertices should end up when loaded. If you can load them in (per mesh-object) then use a matrix4 to transform the vertices.
That should solve the problem with the Parking-Lot scene
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

yeah i thought so too...but the ParkingLot scene has no pivots. this is really weird

EDIT: I kinda solved it. The yaw seams to be stored inversed so i just switched signs and now it seams to work perfectly.
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.
fmx

Post by fmx »

cool. Looking forward to seeing your contribution become a part of Irrlicht in the future :D
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

lol totally forgot to post the code....

EDIT: added to first post
Last edited by sudi on Mon Jan 19, 2009 9:47 pm, edited 1 time in total.
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 »

I would love to see this loader become part of the engine. but i'm not sure how i'm supposed to submit it. just with the tracker and patch file?
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 give the source a proper license, and maybe clean up the static functions and inline functions (put them all into the private block as usual member functions, with implementations in the cpp file). Then provide a downloadable version with a minimal test application and some test files (watch the licenses for those files as well). I can immediately put the loader into the irrExt project (I'm not putting this into the main library as long as we don't have a mesh writer for it as well).
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

ok i made the loader a bit nicer looking.
Now working on the writer. But problem is the irrlicht mesh can't really be exportet to a gls file bc that file has lightinformation and all kinds of stuff the mesh obviously doesn't have. In other word when u load that scene back into gile[s] after saving with irrlicht you will have to reposition all lights and again set stuff like cast shadow/receive shadow and so on.

Other than that this might be a pretty cool way of saving lightmapped scenes of irredit into a mesh only format including the lightmap.
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.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

And thus appear the fundamental difference between a mesh and a scene. Giles seems to produce scene data with mesh information contained directly. This seems entirely different than mesh data. What would be one step more awesome would be to be able to save scenes in gile format and back (with lights too) ^^
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

well loadng the lights isn't a problem. but wouldn't that kill the purpose of a meshloader?
What i could do is inherit from IAnimatedMesh and add a new one just like the IQ3LevelMesh. That way i could easily add the lights to a list there and with a simple call to addLightsToScene you could load the lights.
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 »

We already have the collada loader as a scene loader, and also your an8 loader was loading more than one object IIRC. The basic idea is to return an empty scene node when loading a scene, with all scene elements as children of that node.
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

yeah but that can't be integratedinto a mesh loader or at least shouldn't be intergrated. when i wrote the an8 loader i kinda missinterpreted the MeshLoader 8)
Or do u mean i should drop the idea of a Gile[s] meshloader and instead write a Gile[s] SceneLoader/Saver?
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.
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Yes :) That was at the very least my point/idea :)

Also, on a side note, good job!
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post by sudi »

Just updated the source with proper license. still working on the meshwriter but will add a sample testcase for loading a mesh.
Maybe i will change this later into a sceneloader. But the problem would be again that u will still have to place ur gameentities with some other tool and fileformat.

EDIT: added download link to a sample application and scenes in the first post
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.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

looks truly amazing!
Post Reply