map loading releated question

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
itsjuan2001
Posts: 12
Joined: Tue Jul 05, 2005 7:05 pm

map loading releated question

Post by itsjuan2001 »

is it possible to load maps from a XML file, (kinda like crystalspace does)
within irrlicht?

reason i was asking this was cause, i want to have complete control over the polygons within the mesh (so i can apply different textures and material types for each face if wanted)

i tried to find a function within irrlicht for defining a polygon (i'm sure it's probally somehwere, but i'm a newbie to C++ and api docs)

i was thinking that if i made a function that kept creating polygons until all the vertices in a file were used that it should work, but i don't know how i would go about loading textures and meterial types with it.
Reason why i want to do this cause i am sick and tired of using BSP's and can't define if i want a wall to parallax mapped or not. (if there is a way, let me know)

also i thought it would be useful because in the future i could attach entitie definitions to certain polygons (like make 2 sets of boxes into glass entities or make a face into mirror entitie)

Any thoughts, suggestions or help you could provide on this topic would be useful, thanks in advance
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There are several mesh file formats which are based on ASCII text with which you could work. But this won't fix all your problems. Better use custom creation methods by learning how to work with mesh buffer, s3dvertex, and vertex indices.
A scene serialization file format in XML is being developed by Niko for one of the next versions. This would probably better fit your intentions then.
itsjuan2001
Posts: 12
Joined: Tue Jul 05, 2005 7:05 pm

Post by itsjuan2001 »

hybrid wrote:Better use custom creation methods by learning how to work with mesh buffer, s3dvertex, and vertex indices.
So the best way of doing that would be deriving a class from ISceneNode
and finding out how to pass it to the mesh buffer after storing the indices?

(being a newbie, everything is hard to understand right now but i don't work, so i have 24 hours a day get up to speed)

After looking over the forum i thought i would take a look at the tree scene node in projects forum, seeing as it generates a mesh from scratch (from what i understand, i might be wrong)
and trying to apply the same method to my method.
Baal Cadar
Posts: 377
Joined: Fri Oct 28, 2005 10:28 am
Contact:

Post by Baal Cadar »

itsjuan2001 wrote:So the best way of doing that would be deriving a class from ISceneNode and finding out how to pass it to the mesh buffer after storing the indices?
No, best way is to subclass IMeshLoader and to use ISceneManager::addExternalMeshLoader to register your mesh loader with the engine. I don't know how much a beginner you are. Try first to understand the vertex buffer / index buffer concept. This is described in numerous texts over the internet, a websearch will yield useful results. If you understand what vertex / index buffers are about, look at the irrlicht API docs on IMeshBuffer, IMesh, IAnimatedMesh and the different vertex structs. Also take built-in mesh loaders as exaples for your work.

Deriving from ISceneNode is completely overused.
No offense :)
itsjuan2001
Posts: 12
Joined: Tue Jul 05, 2005 7:05 pm

Post by itsjuan2001 »

I am almost a complete noob, the most sophisticated program i have made to this date, is a program i use to preview particle systems with complete control over how they are being rendered/created at runtime. (useful if you want to create a specific effect and want to know exactly how it it'll look during runtime, i used it to make snow) I used it to make a snow effect and rain, i stopped working on it after running into a few problems, like runtime errors and for some odd reason i can't get driver->draw3dbox to actually draw a box (i wanted it to visually show the boundin box/area that particle system uses) it would'nt cause a error but i would'nt see it during runtime. but then again for the life of me i don't know how to specify the position of the box. (which reminds me, i think there is a problem with a water scene node and the fadeout particle affector, with trying to drop them and create them in runtime causing a debug error pointing to "smgr->" )
i mostly copied and pasted it from tuts and stuff but about 30% is coding done by me.
but anyways you can tell from above i don't know much beyond what i've learned from tuts and cplusplus.com


I was thinking as i was trying to template this whole thing out (i think doing that before actually coding makes it easier, as i have a blueprint to work with) is that i'm not entireally sure how lighting would work with this.
that was one of the problems i had with bsp's, i'm not sure how to use lights with them or it is possible, i tried loading a bsp as a tangent mesh and it loaded fine with barely any lighting on the textures but i could't get the light to work on it, but anyways my question is this:

Do you think it would be too difficult to have lights working with my new method if i subclass IMeshLoader? or will the engine actually handle this automatically for me?
Also is there anything i should take into consideration regarding stuff i might have to implement after making this that is availible from the current mesh loaders but won't be from the base class?
Post Reply