(u,v) mapping in Wavefront .obj export

I have a question about an exported .obj Wavefront file. The .blend file is attached. I couldn’t attach the .obj file so I am appending it to this message.

This is a simple texturing of the default cube in which I have painted a different number on each side. The bitmap is the default 1024x1024 size and was created using the UV image editor.

Look at the .obj file, the first face vertices. Then look at the cube in Blender, same vertices. In Blender these vertices form part of the ‘5’ face, specifically the upper left, lower left, and lower right.

But in the .obj file, the texture coordinates, which are:

vt 0.333333 0.498471
vt 0.001020 0.500000
vt 0.000000 0.001529

form part of the ‘1’ in the bitmap, assuming the (u,v) mapping is as follows: (0,0) for upper left hand corner, (1,1) lower right hand corner.

Although I am a fairly new Blender user I have been having great success in using Blender – except for this one feature. Probably there is something about the (u,v) mapping I don’t understand, any help would be appreciated.

I am using the ‘smart projection’ unwrap method.

P.S. – is there a way I can click on a vertex while in Edit mode and view the corresponding (u,v) coordinates for the vertex? That way I could compare with what I see in the .obj file.

.obj file follows:

Blender3D v249 OBJ File: texture3.blend

www.blender3d.org

mtllib texture3.mtl
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 0.333333 0.498471
vt 0.001020 0.500000
vt 0.000000 0.001529
vt 0.332314 0.000000
vt 0.000000 0.998471
vt 0.333333 0.501529
vt 0.332314 1.000000
vt 0.665647 0.500000
vt 0.666667 0.998471
vt 0.334353 1.000000
vt 0.998981 0.000000
vt 1.000000 0.498471
vt 0.666667 0.001529
vt 0.667686 0.500000
vt 1.000000 0.501529
vt 0.998981 1.000000
vt 0.334353 0.500000
vt 0.333333 0.001529
vt 0.665647 0.000000
vt 0.666667 0.498471
usemtl Material_texture3.bmp
s off
f 5/1 1/2 4/3
f 5/1 4/3 8/4
f 3/5 7/2 8/6
f 3/5 8/6 4/7
f 2/8 6/9 3/6
f 6/9 7/10 3/6
f 1/11 5/12 2/13
f 5/12 6/14 2/13
f 5/15 8/16 6/14
f 8/16 7/9 6/14
f 1/17 2/18 3/19
f 1/17 3/19 4/20

Attachments

texture3.blend (136 KB)

P.S. – is there a way I can click on a vertex while in Edit mode and view the corresponding (u,v) coordinates for the vertex? That way I could compare with what I see in the .obj file.

Press N for the transform properties panel

You haven’t packed your texture inside your blend file so the texture is not visible. Therefore not sure exactly what you are asking.

There was a recent bugfix with uv coordinates on exported obj files. The discription was just:

bugfix [#22037] OBJ exporter produce wrong UV

Maybe it will work with a more recent version, at least revision 31322.

I just redownloaded and installed the lastest 2.49b version. The problem is the same. I will try the new beta version at some point.

I can’t upload the .blend with the bitmap packed. Maybe this is a size problem. The bitmap is 1024x1024.

I can view the cube vertices (x,y,z) when I use the ‘N’ option but I still don’t see an option to view the (u,v) vertices.

Thanks for the replies so far.

I gave up trying to figure out this problem with .obj files so I tried the .x export instead.

If I use .x export settings ‘right-handed system’ and switch to ‘y-axis up’ then I get the vertex convention my application needs.

Then I just add +1 to the ‘v’ texture coordinates and I get (u,v) with (0,0) in upper left corner with +x going right and +y going down as I am used to.

I just needed to change my app to parse the .x files instead of .obj. (I am not using DirectX since this is an experimental software renderer I’m making as part of a game. So my app was parsing .obj files, now it is parsing .x files with the adjustments just mentioned.)

Hope this helps others who may have run into this problem. I’ve seen lots of questions on the net about .obj problems but so far the .x is working for me.

I’m a new Blender user (about 3 months) and I think overall it is super.