Inverted Texture after loading from Obj?

Started by
4 comments, last by Tingle 13 years, 1 month ago
I created an .obj importer for my DirectX D3D9 app. Ive flipped the X and Z of the .obj to make it Left Handed like DirectX is, and flipped the U,V's 'v'. But my texture on the mesh seems inverted in its self and not as if it was Flipped on the 'u'. This is what I get:
http://img844.imageshack.us/img844/7957/74014671.png

as you can see, all letters are inversed. Wich is not the case in Maya
Advertisement
Just flip the "u"'s


texC.x = 1 - texC.x;

Just flip the "u"'s


texC.x = 1 - texC.x;



Doing this results in flipping the whole texture coords. This sets the texture around correctly, but the UV's are no longer in place where they should be.
I can correct my base problem manualy in Maya by clicking on each "UV" layout element and fliping it. So basicly reproducing this mirrored effect in maya so it will turn out correctly in my D3D App. But shouldnt there be a reason why this is mirrored in its self? Its as if the Texture was looking at itsself in a mirror...

Now by doing what you told me to, I get this:
http://img821.images...89/71708228.png


So to sum up what I did to the original obj mesh data:
I fliped the X & Z of the Vertecies, the X & Z of the Normals, and the U & V of the texture coords
If the texture is applied symmetrically to the mesh, you should be able open the texture in Photoshop or even Paint and flip it horizontally (or vertically). Then save it.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I think you guys are missing the point...?
The texture is INVERTED in its SELF. Meaning that not the whole texture is "flipped" in some direction, but the UV Element/Pieces/Layout/Shit-Terds or what every you want to call it, Are flipped in thier own position.
See:

Texture with UV:
http://img705.images...16/61742628.png

Is equal to this in Maya:
http://img841.images...16/42089178.png

Is equal to this after exported to .obj and loaded into my D3D App after altering some things ( fliped the X & Z of the Vertecies, the X & Z of the Normals, and the V of the texture coords ):
http://img651.images...00/75162327.png


NOW, lets take alook at the UV's. It seems that the UV "Elements as you can see on Pic 1 are correct in Maya, but pretty much inversed in them selfs in my App? This is by no way logicly possible if you think about it, its as iff the mesh is inside out, but this wouldnmt be possible because if it was, the mesh would be only rendering the inside?.
Ok, I found a solution. I set the culling mode to draw clockwise and inverted only the Z coords on the mesh, turning the mesh inside out and rendering it inside out... This sound stupid? Or is it a correct approach?

This topic is closed to new replies.

Advertisement