Wavefront .obj exporter UV issues

Hello everyone,

A while back I started work on a DirectX 10-based game engine. I’m currently working on creating meshes from .obj-files. I’ve created a model in Blender, a chess pawn (nice and easy :wink: ), and then textured it with a UV-mapped image.
In Blender the texture shows up fine, and when I export to a DirectX .x file and view it in the .x viewer, everything looks the way it should.
However, when I export my blender project to a .obj file, the texture shows up, but is horribly displaced (see image link). I’ve tried two .obj exporters, both with the same results. I can’t seem to figure out where its going wrong, I’ve tried everything I can think of. Granted, since I’m quite new to blender, this isn’t much. Can anyone think of anything I can do about this?

Any suggestions will be appreciated.

Sincerely,

Morchaiel

Image link:
http://img690.imageshack.us/img690/2984/pawnmessed.jpg

What was it supposed to look like. Has the uv coordinated been flipped vertically, horizontally or rotated 90 degrees? Once you know what the actual change to the mapping is the easier to find the solution.

Of course it would be handy to show you what it should look like, sorry :).

The green part of the texture should be on the bottom of the pawn:
http://img694.imageshack.us/img694/2975/pawnbottom.jpg

The rest of the pawn should be covered in the blank wood part of the texture:
http://img155.imageshack.us/img155/6240/pawnsidejpg.jpg

The bottom of the pawn from the .obj file (wich is a separate subset from the rest of the pawn) looks like the texture may need to be rotated 180 degrees, maybe:
http://img715.imageshack.us/img715/5113/pawnmessedbottom.jpg

as a reference, here’s the texture:
http://img90.imageshack.us/img90/247/pawntxblank.png
This texture is used for both subsets.

That’s the silly thing, it’s really hard to tell where it goes wrong. I;ve checked the .obj file, the UV coordinates are all there…

On the bottom of the pawn it kind of looks like the texture needs to be rotated 180 degrees, I guess. Also, on the body of the pawn it looks like the texture’s too small.

I hope this clarifies the issue

It looks like you need to flip the texture vertically. I don’t know the viewer you are using but when you export an obj out of zbrush into blender you also have to flip vertically your textures.

Richard

You, sir, are a genius!

I feel kind of stupid… I could have told from the way the texture was aligned on the bottom part of the pawn. After having manually flipped the image just now, I tried to import a .obj supplied with sample code in the DirectX SDK. This made me realize that blender isn’t the problem.

Upon importing the .obj from the DirectX SDK I noticed that the texture appeared upside-down on that in blender.

So I guess it has something to do with the DirectX code.

In any case, thanks very much for your quick replies, Richard. This is quite a relief.

Regards,

Morchaiel