www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MrFluff on August 08, 2011, 11:52:44 am

Title: Problem with texturing
Post by: MrFluff on August 08, 2011, 11:52:44 am

When I import a model from a 3DS file the texture looks fine. Unfortunately I use some elaborate animations on the object so building an animated object from 3DS files isn't an option.

I included a screenshot from my app which displays the not-animated 3DS model to the most left, and 3 instances of the animated MD2 model. There are some display problems when making a screenshot on the android device with the DDMS tool when models are animated so that's why the animated models look like parts of multiple models but I guess its easy to see that the textures of the animated models look kind of placed wrong.

When I import the MD2 models I actually have 3 files: the soldier, the shield, the sword.
So I thought this might case the wrong texture mapping.
But then again I merged all these objects in my 3d dev tool and imported only a single animated MD2 file (the model in the middle which is displayed a little bit below the other models) which didn't help in any way.

How can I use the animations from the MD2 files but use the texture mapping from the 3DS file? Or what is the difference in texture placement anyway?

Thanks in advance :)

[attachment deleted by admin]
Title: Re: Problem with texturing
Post by: EgonOlsen on August 08, 2011, 12:19:26 pm
Try to flip the texture when dealing with md2. IIRC, md2 assigns its coordinates upside-down.
Title: Re: Problem with texturing
Post by: MrFluff on August 08, 2011, 01:45:30 pm

Thx for the quick answer.

I just flipped the original texture (jpg file) horizontally, vertically, and even both. Unfortunately none worked out :/.
The original model + texture was downloaded from turbosquit http://www.turbosquid.com/FullPreview/Index.cfm/ID/407824 (http://www.turbosquid.com/FullPreview/Index.cfm/ID/407824) and TBH i do not know how this texture is mapped to the model at all (i guess for this someone needs to think different ^^).
I uploaded the original (compressed for this forum) texture that works for the 3ds file. Maybe someone can give me a hint of how to change the texture accordingly.

[attachment deleted by admin]
Title: Re: Problem with texturing
Post by: EgonOlsen on August 08, 2011, 07:40:58 pm
There's no magic involved...either your exporter to md2 screws the texture coordinates up or your flipping/mirroring didn't work correctly. Can you upload the md2 for us to see...?
Title: Re: Problem with texturing
Post by: MrFluff on August 08, 2011, 08:58:09 pm

of course here are links to the MD2 files and the flipped texture:

http://smartbook.dmt.fh-joanneum.at/swordsman/armored_swordman.jpg
http://smartbook.dmt.fh-joanneum.at/swordsman/swordsman_shield.md2
http://smartbook.dmt.fh-joanneum.at/swordsman/swordsman_weapon.md2
http://smartbook.dmt.fh-joanneum.at/swordsman/swordsman.md2
Title: Re: Problem with texturing
Post by: EgonOlsen on August 08, 2011, 09:23:01 pm
Looks like as if the exporter has screwed the coordinates up. If i load the model with DeepExploration it's also wrong and i can't find a way to rotate/turn/flip the texture to make it look right. Please check your exporter/your exporter settings. Have you tried to re-import the md2?
Title: Re: Problem with texturing
Post by: MrFluff on August 08, 2011, 10:02:08 pm
You were right there were some problems with the exporter. I could fix them however and now the soldier gets displayed correctly even without flipping the texture.

Thanks for your hint :).

BTW I am working on a small library that uses JPCT-AE and incorporates a similar design like XNA, using game components and game services. when its finished there are services that feature location based augmented reality (sensor alignment and displacement according to GPS coordinates) and other functionality that simplifies android development out of the box. maybe you or others are interested in this. Do u want me to make a thread with a download and example code?

Good evening anyway :)
Title: Re: Problem with texturing
Post by: EgonOlsen on August 08, 2011, 10:07:11 pm
Sure, i would love to see some contributions.