I’m working on my .x loader code and converted the demo to run with jme because jogl does bad things on my new computer, but for some weird reason it’s like half of the polygons are drawn backwards.
The model I’m using loads fine in game space light (where it was created), I don’t have another model edittor that can open .x files (or any other format game space light saves to) so I can’t check if other editors handle the file ok or not.
I’m pretty much just sticking the information into a TriMesh, straight out of the .x file, do I need to keep looking for stupid mistakes in my own code or is there some kinda trick with tri meshes that I might have overlooked?
Nevermind, just found like the 15th stupid mistake in the 3 lines of code that put together the trimesh…
About the loader…
Are you going to cover the entire X format (in the limit of what jme can handle, of course) ? Or just extract the polygons and textures ? I think It will interest some people here who complain about the lack of .X support…
Chman
This is the loader that was mentioned before in some of the threads about .x, it already supports loading a static model with texture info, color info, etc… there is an issue with materials that are defined ‘globally’ that I intend to fix, then I’m going to work on bone info, probably be tricky since I’m not very experienced in that area, and I haven’t even looked at how a .x file looks with any animation information (I have a certain dwarf on hand… but I’ll probably create a super simplistic skeleton so hopefully identify anything in the file easier because I made it). Animation is the only thing that seems to be missing (everything that is not supported now seems to be for animation). Guess the next step is to go back to that getting started pdf file and figure out how to get my trimesh textured up…
Err, guess I shoulda mentioned that what the loader supports, isn’t specific to jme, so it doesn’t convert files or anything like that yet.
In the process of updating things, and testing stuff with the loader and jme… to support multiple textures do I need to have multiple tri mesh objects, one for each material? I suspect that typically a model would have been skinned using unwrap or some other tool like it so normally there would only be a single texture? Can anyone confirm this?
Also, when it comes time to convert to the jme format when my loader is more complete, do I simple create my object and load it into the scene graph, and then tell jme to write it to a file with BinaryWriter? That’s how I think it works so far but I haven’t really looked into it a lot yet. If that’s the case, and I load a model and split it into several tri mesh objects (due to multiple materials being used) will the binary writer handle that well (I assume this would be like saving a scene… and not as ideal as a single skin mesh)?
the .jme format supports multitexturing, so you are fine there. The basic process you are going to want to follow is:
- Build your model in your modeler.
- Export to a format that (a) supports your model and (b) has a jme exporter - 3ds, milkshape, obj, md2, md3, ase…
- either use one of the file converter tools in Third Party Applications or convert using the binary writer in your code. (Personally, I’d recommend converting prior to the game starting as it would be faster).
The loading process will split things up into trimeshes as needed (i.e. as the model is set up when you create it), you shouldn’t have to do this manually.
Actually… I’m talking about a loader I’m building to handle .x files, and when I said multiple textures, I didn’t mean for the purpose of multi-texturing, what I was talking about was the .x file format allows multiple texture files that are applied to different parts of the mesh. This is why I think I need to split the mesh up by material (or at least texture) to texture it correctly in jme.
I’ve been doing some work on the parsing side of my loader, and I’ve just about got it finished up to the animation stuff, just working out a few bugs now and testing things. I figure I can handle parsing the information no problem, but my biggest issues have been actually using the information I parsed from the files in jme. I’m pretty sure the more experienced jme users could pretty easily adapt the information I load from the file into a jme scene, especially if they’ve already written another converter (with bone support). Is anyone going to be willing to help or even better complete that side of things for me? I will probably be able to slowly muddle through it as I learn jme but it’ll take a while, I have other stuff that I need to be putting my time into before I can focus on jme again.