Loading md5 model problem

hi … im actually trying to use md5 model and i found md5reader2. then i try to play around with the examples like FishTest, loading my own model into it … but when i run it, only can see a blank screen(no error at all)… anyone know roughly what/where the problem is?  :?please … really need help here … or can suggest any other examples/ tutorial available ard?  :expressionless:

That usually happens when the loader is not able to locate or load the textures. Have you tried setting the classloader for the loader? What we did is that we created a custom classloader for the md5 reader, and passes that one to the loader.


    MD5MeshReader meshReader = new MD5MeshReader();
    meshReader.setProperty(MD5MeshReader.CLASSLOADER, classLoader);



You can also try to use the default classloader instead:

    getClass().getClassLoader()

nope … hmmmm… if that is the problem, i think it should have shown an file not found exception in the first place … any more ideas pleass …  :expressionless:

That is part of the problem. The loader does not inform you that the file is missing.

really ?!!! im using this ->



MD5MeshReader meshReader = new MD5MeshReader();

    meshReader.setProperty(MD5MeshReader.CLASSLOADER, classLoader);



but still have the same problem … how can i know or make sure that it has loaded in? anything that i can do to solve this? thankz …

The default classloader loads resources relative to the working directory, usually the directory where you started the application. You might also want to check the md5mesh-file and see where the textures are set to be in that file.

currently no textures for my model … btw … i think im working on the right directory … coz i put them together with the fish models … so its impossible that i can load in the fish with animation but not my model … haiz … all i can see is black screen now …  :’(

If you're using the unmodified fish.md5mesh, the texture is defined as:



shader "models/fish/textures/Fish_a"



which means, that there should be a file named Fish_a.tga in the "models/fish/textures/" subfolder.

so u mean … i see nothing because i never provide texture to it?!! am i correct? :-o

I am not sure that is correct, try texturing the model with a bad path after you have created it.  You should get a nice and ugly pink texture (jME default).





Whats your verts count, when displaying?

vert count 24 … mesh 6 … does that mean the model has been loaded in? urmmm … what do you mean by texturing the model with bad path? i try to edit the md5mesh file with changes to shaders(refer to other's models texture) … still cant see anything but a blank screen … haiz … model problem?

Get model as a spatial



Then apply a texture state to it directly.



Also, run the example again; I think the fish has more verts than that.





24 verts in 6 meshes sound like 6 quads to me :wink:



Also, lets see some code  :stuck_out_tongue:

im using the exactly codes of FishTest … just changing the loc of where my files is… hahha … haiz … anyway thankz alot for the replies …  ://

read here

after all, a problem coz by texture … alright i will test it out first … thankz everyone for the replies!

Anyone know why the OBJ importer throws an error when a texture is not found (using a material file) and and the MD5 model importer does not?

this is solved already, if a texture is not found. the default jme texture will be used.



the pink thing~ :smiley:

I answered to a question posted by basixs (that knows about the pink thing) just 3 hours before. Read the post before mine. I found his post in the list of "Show unread posts since last visit.". Then I read all the thread and I thought to share my approach to load resources in a external path (resources not inside the java package path).



Moreover:

a) the pink thing is not a solution (in my opinion) but just a sort of hack or at least a temporary work around. Though I think that basixs did a good thing suggesting it.

b) I think that a project like MD5 Reader, should be able to manage this kind of situations correctly. And this is the reason of my excuses.

c) I think that the way MD5 Reader currently loads resources is not enough versatile. A final developer should be able to choose if store his resource data in a directory externaly of the java jar package.



When I follow a project I love it. And, as a developer, I would like to give it all the features that I would expect from a similar project, as a user.

good news! i have the animation part done! well not using jme's bone unfortunately. hopefully renanse can come up with a solution.



anyways, my current implementation uses the jme resource locator tool. is that ok?

Mentioned this to neakor on IM, but just to hopefully get someone else to help…  I'm completely swamped at work and the only jME related things I can do at the moment is focus on pushing the 2.0 changes through the local review process before it gets out the the public and prepping for the JavaOne session.  Maybe someone else could volunteer to help neakor out with getting his md5 stuff working using as much jME classes (versus custom classes) as possible?