Skip to main content
GameDev.net gamedev.net
🔒 Locked

Problem with MD5 texture mapping

Started by doronf Aug 22, 2008 at 2:48 AM 4 replies 1.3k views
Original Post
doronf
doronf
I thought it would be nice to add MD5Mesh support in my engine, but things didn't go so well with the texture mapping. The texture seems to be mapped in the wrong direction. As an example, see the text on the case in the following image: http://1.bp.blogspot.com/_cxgaRZsxcEQ/SK5u5qVa3JI/AAAAAAAAAEs/JaicPvU2ilE/s1600-h/BFGCase.JPG The text is right-to-left for some reason. Do I need to change something in the UV after loading the file? Maybe the way I load the TGA texture (I use the DX functions for loading the texture)? Any help would be welcomed.
doronf
doronf
I tried that but its not doing any good. If I flip the U coordinate (U = 1 - U), the writing is in left-to-right order, but the texture is mapped on the wrong places.

Note that in the texture (which I wont load since there are copyright issues, see the illustration bellow) the text is not located in the middle of the image (horizontally), so if I flip the pixels or the mapping, there is no way the texture is going to be mapped correctly.

_________________________
|..............|........|
|..............|........|
| Bla bla bla |........|
|..............|........|
|..............|........|
-------------------------
jfdegbo
jfdegbo
Then why not flip the mesh ...
x = -x
or something like that
_____My little engine : I.E.
Gage64
Gage64
Quote:
Original post by doronf
If I flip the U coordinate (U = 1 - U), the writing is in left-to-right order, but the texture is mapped on the wrong places.


If I paste your image into a drawing program and do a horizontal flip, the texture looks fine to me, so it seems like it should work. Could you post a screenshot?
doronf
doronf
Quote:
Original post by Gage64
Quote:
Original post by doronf
If I flip the U coordinate (U = 1 - U), the writing is in left-to-right order, but the texture is mapped on the wrong places.


If I paste your image into a drawing program and do a horizontal flip, the texture looks fine to me, so it seems like it should work. Could you post a screenshot?


The link was to the screenshot. As I mentioned, the texture is not symmetric, so flipping the image (or the UV which is the same) ends up with the texture mapped to the wrong place.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.