Skin not aligned properly on model

Started by
8 comments, last by jonnys 17 years, 11 months ago
When I load a .md2 model in my opengl (c++) project and try to put a 256*256 tga skin on it, the texture is not mapped properly (the skin is not aligned properly). What could be the problem?. Here are the links to some screenshots to show the problem more clearly: http://img64.imageshack.us/my.php?image=skin12ui.png http://img64.imageshack.us/my.php?image=skin22bx.png Im new to the skinning so please any help would be greatly appreciated. Thanks.
Advertisement
what mapping method are you using? if you're uv mapping it then everything should be fine unless you are not telling the exporter to "preserve tex coords". and if you are then it may be something with your code... however i can't be too sure, you are not providing very much info.
-------------------------Only a fool claims himself an expert
I am using the uv mapping method; I am using milkshape 1.75 to export the model as a md2, how can I know if I am not telling the exporter to "preserve tex coords"; What more information can I give you to help me?
The texture doesn't look stretched unevenly, so the relative positions between the uv-coords seems to be ok.
My guess would be that it's probably an error in the code for loading the texture, mirroring it or displacing it in some direction, or an error in the code that loads the uv-coords, displacing or mirroring those.
Quote:Original post by Necator
The texture doesn't look stretched unevenly, so the relative positions between the uv-coords seems to be ok.
My guess would be that it's probably an error in the code for loading the texture, mirroring it or displacing it in some direction, or an error in the code that loads the uv-coords, displacing or mirroring those.




So...what should I do?...where in the loading code do you think it is?....should I post the code...which parts of the code should I post?
I would try checking the texture and uv-coordinates in some editor. If you can locate which parts of the texture ends up where on the model, you can probably get an idea of what's going wrong.
Try testing your code on a known, good model from a game you can borrow to test this. Or a free one from online. Just something you know works as is.

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety." --Benjamin Franklin

Looks like my old free zombie model? anyway it also looks like the UV's have been flipped either horizontally or vertically or possibly both, not sure how or why but check your loader code and see if you can flip the UV's...or possibly do it in milkshape and re-export/test to see if it works!!
Quote:Original post by PsionicDesign
Looks like my old free zombie model? anyway it also looks like the UV's have been flipped either horizontally or vertically or possibly both, not sure how or why but check your loader code and see if you can flip the UV's...or possibly do it in milkshape and re-export/test to see if it works!!


It is your model!!(I am using it to test my loader. Thanks...It looks great, keep up the good work). By the way I forgot to tell you that the model was rendered perfectly in another md2 loader code :? , that's whats confusing me :? This means it must be in my code. How do you flip UV's in opengl?
Hello... anybody?

This topic is closed to new replies.

Advertisement