gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Textures on MD2

#60530 - iainprice - Fri Nov 11, 2005 1:07 pm

I am currently having a few problems with textures on MD2 models.

I can load and display an MD2 file fine.

I have created the models in Lightwave, converted them using QData but the skins are funny sizes, if I use a tool to stretch the skins to 128x128 and apply them and then convert the pcx files using pcx2tex and load them the textures are still a little unusual.

The colours are fine but the mapping just seems wrong. It's not just stretched or rotated, it seems broken into bits... any advice?

Thanks.

#60554 - mike260 - Fri Nov 11, 2005 6:46 pm

iainprice wrote:
I am currently having a few problems with textures on MD2 models.

I can load and display an MD2 file fine.

I have created the models in Lightwave, converted them using QData but the skins are funny sizes, if I use a tool to stretch the skins to 128x128 and apply them and then convert the pcx files using pcx2tex and load them the textures are still a little unusual.

The colours are fine but the mapping just seems wrong. It's not just stretched or rotated, it seems broken into bits... any advice?

Thanks.


Got any screenshot showing the problem?
_________________
"Ever tried? Ever failed? No matter. Try Again. Fail again. Fail better."
-- Samuel Beckett

#60662 - iainprice - Sun Nov 13, 2005 3:00 pm

I have figured out what is wrong. I have a lwo and I convert is using lw_qdata to an MD2 with a forced skin size of 128x128.

I then convert it using md2todsdl.

I then use the 128x128 skin bin and the md2 bin but the skins are not quite right.

This image shows what is wrong... only half the mesh is being mapped. I have tried using maps of different sizes but still things are not right.

www.geckogames.freeserve.co.uk/problem.jpg

I'm not sure if I have a fault with the version of qdata or md2todsdl....

Has anyone else done similar conversions?

Cheers.

#60709 - blaisef01 - Mon Nov 14, 2005 1:15 am

I don't know if this would be any help but when i wrote my TGA to my own crap DS raw format convertor I found that i had to flip the image so it was upside down before exporting it and in my DS code (i'm using libnds) i had to swap the u and v texture coordinates around.

give that a go and see what happens...

#60763 - iainprice - Mon Nov 14, 2005 4:51 pm

The problem I have is which tool is wrong.

I think lw_qdata is mapping both sides to the 128x128.

I am not sure if the d2todsdl tool is only mapping on side to 128x128 OR if the code I am using to show the MD2 is only mapping one side to the 128x128?????

Any ideas?