.Obj or .3ds texture coords???

Hello,

Sorry if this is in the wrong area, I’m tired and it was close as I could see.
I have been wanting to parse the 3DS format and have so much done but
texture coordinates. I looked at the .obj format thinking I may even use
it instead but, the texture coordinates are wrong, or I do not understand
how to read them.
I have a cube that I mapped uv mapped each face with approx. 1/12
of the image. It is a 512 x 512 .png file with only the top portion of the
image file with and images, the bottom half is white.
When I decode the file, my object is correct but the mapping is not.
I “hand coded” the texture coordinates of 3 faces and they work as they
“should”.
Part of what I see is there should not be any “u” coordinates above 0.5
in value since I do not map from the bottom half. There are values there
in both the 3ds and obj formats.
It should have u v values for the texture coordinates that range from
0.0 to 1.0, is this right ?
The numbers almost make more sense if they were v then u and
absolute value of 1 minus the coordinate.

Does someone know what I am doing wrong and can help me please?

both 3ds and obj export texture coords correctly (tested a lot), the values with most formats is between 0.0 and 1.0, but not clamped.

Do you have a thought where I might start looking? I am really stumped. I am relatively sure my file parser is correct and there is no denying the obj output.
I am using 2.48a.
I am not saying there is something definitely wrong with the export, I just can’t find the method for reading it correctly.
I can hard code the gltexture lines with the values I know to be correct and the image maps as it should.
The hunt for useful information grows ever so much harder in the “information age” as everyone now wants to sell it. So much of what you find can not even be trusted.
If anyone knows where I am goofing up or at least has some idea where I might look I would love to hear form you.

Thanks

kumado

Edit the UV’s in blender and enable “Normalized Coordinates” - the number you see in the UV transform panel will match OBJ and 3DS Exactly.
There must be some complication with how your dealing with the UV’s because this is very simple, further almost all formats deal with UVs like this.

ok, looking for that now. It is not something set by default?
also, thank you very much for your time in helping me. I am a teacher and
sometimes have not as much time as I would like and it is frustrating to hit
a point that the answer is a bit hidden from me.

What I do is start with the beginning cube. Split the view and make the second a UV/ Editor.
I load my image, select the face towards me on the cube. I select 2 pixels at a time and grab with X or Y to drag them to my square I wish to map to. I start with the upper most left hand corner. I save the blend file and then I export to obj and 3ds so I have “where I was”. When I look at the object file thats when I see the coordinates do not seem to be what I expect them to be.

I think it should be just so easy as well. What bothers me the most, I wonder what stupid thing I am doing and don’t see it. :frowning:

Again, thanks for helping me. I know everyone is busy or busier than I am as well.

kumado

ok, got my cert. test out of the way and a little sleep. Not that it does much.

I opened my image in Gimp and inverted it top for bottom, remapped my cube, exported it. I used those coordinates with the original image and the mapping is right on. In OpenGL, the top left is 0,0 what I am getting form the export, the lower left is 0,0.

That done, any thoughts where I am messing up?

I guess I can always invert my images for mapping but seems a bit off.

Thanks

kumado

Hey kumado, sorry if I sounded patronizing before :confused:

some points that may help…

  • FBX/OBJ/3DS/LWO/VRML/WRL/OpenFlight all use UVs like blender
    Where 0,0 is bottom left, 1,1 is top right.
  • Exceptions are PLY inverts ‘V’, MD2 IIRC uses pixel values rather then floats, probably to save space, its an old format.

You have been no way but helpful and I thank you.

Finding 0,0 at the bottom, I really should have noticed it earlier. Guess I get
more impatient as I age :eek: so I had not looked as close I a should. I also do not
get as much time back-to-back so I “start over” often.

If nothing else, I can save a copy of the images inverted for the display stuff, at that point it is just data anyway, or I may find the switch I need.

Thanks much for your replies and help! I am somewhere now.

ttfn

kumado